Skip to main content
Docs

createScope()

Creates a new machine scope, allowing the specified machine to access another machine.

function createScope(machineId: string, toMachineId: string): Promise<MachineScope>
  • Name
    machineId
    Type
    string
    Description

    The ID of the machine that will have access to the target machine.

  • Name
    toMachineId
    Type
    string
    Description

    The ID of the machine that will be accessible by the source machine.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const machineId = 'mch_123'
const toMachineId = 'mch_456'

const response = await clerkClient.machines.createScope(machineId, toMachineId)

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/machines/{machine_id}/scopes. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on