or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

authentication.mddevice-management.mdindex.mdmfa.mdsession-management.mdstorage.mduser-attributes.mduser-management.mduser-pool.md
tile.json

device-management.mddocs/

Device Management

Device tracking, remembering, and management for enhanced security and user experience.

Capabilities

Device Information and Listing

/**
 * Gets information about the current device
 * @param callbacks - Success/failure callback handlers
 */
getDevice(callbacks: {
  onSuccess: (success: string) => void;
  onFailure: (err: Error) => void;
}): void;

/**
 * Lists all devices associated with the user
 * @param limit - Maximum number of devices to return
 * @param paginationToken - Token for paginated results (null for first page)
 * @param callbacks - Success/failure callback handlers
 */
listDevices(
  limit: number,
  paginationToken: string | null,
  callbacks: {
    onSuccess: (data: any) => void;
    onFailure: (err: Error) => void;
  }
): void;

Device Status Management

/**
 * Sets the current device as remembered
 * @param callbacks - Success/failure callback handlers
 */
setDeviceStatusRemembered(callbacks: {
  onSuccess: (success: string) => void;
  onFailure: (err: any) => void;
}): void;

/**
 * Sets the current device as not remembered
 * @param callbacks - Success/failure callback handlers
 */
setDeviceStatusNotRemembered(callbacks: {
  onSuccess: (success: string) => void;
  onFailure: (err: any) => void;
}): void;

Device Forgetting

/**
 * Forgets the current device
 * @param callbacks - Success/failure callback handlers
 */
forgetDevice(callbacks: {
  onSuccess: (success: string) => void;
  onFailure: (err: Error) => void;
}): void;

/**
 * Forgets a specific device by device key
 * @param deviceKey - Unique identifier for the device
 * @param callbacks - Success/failure callback handlers
 */
forgetSpecificDevice(
  deviceKey: string,
  callbacks: {
    onSuccess: (success: string) => void;
    onFailure: (err: Error) => void;
  }
): void;

Usage Examples:

// List user devices
cognitoUser.listDevices(10, null, {
  onSuccess: (data) => {
    console.log("User devices:", data.Devices);
    data.Devices.forEach(device => {
      console.log(`Device: ${device.DeviceKey}, Status: ${device.DeviceStatus}`);
    });
  },
  onFailure: (err) => {
    console.error("Failed to list devices:", err);
  }
});

// Remember current device
cognitoUser.setDeviceStatusRemembered({
  onSuccess: (result) => {
    console.log("Device remembered:", result);
  },
  onFailure: (err) => {
    console.error("Failed to remember device:", err);
  }
});

// Forget a specific device
cognitoUser.forgetSpecificDevice("device-key-123", {
  onSuccess: (result) => {
    console.log("Device forgotten:", result);
  },
  onFailure: (err) => {
    console.error("Failed to forget device:", err);
  }
});