Using User Identities to Scope Users' Device Access

You can limit your users' access to a subset of devices.

First, create the user identity that corresponds to your user. Configure the user identity with your internal user ID or other identifying information. Then, use the Grant Access to Devicearrow-up-right method to assign the user identity access to specific devices.

After creating and configuring the user identity, create a client session and capture the resulting client session token. When you use this token in your application, such as in a Seam Component, Seam limits you user's access to only the devices that you specified for the associated user identity.

// Create the user identity.
const user_identity = await seam.userIdentities.create({
    user_identity_key: "user-1"
});

// Grant the user identity access to a specific device.
await seam.userIdentities.grantAccessToDevice(
    user_identity_id: user_identity.user_identity_id,
    // Specify the ID of the device that you want your
    // user to be able to access.
    device_id: "054765c8-a2fc-4599-b486-14c19f462c45"
)

// Create the client session.
const client_session = await seam.clientSessions.create({
    user_identity_ids: [user_identity.user_identity_id]
});

// Use this token in your app.
const token = client_session.token;

Last updated

Was this helpful?