Platform Methods

Access TelemetryOS platform features including accounts, users, devices, applications, and proxy services for external content fetching.

Platform Methods

Access to accounts, users, devices, applications, and proxy services.

Overview

These methods provide access to TelemetryOS platform features and information:

  • Accounts - Current account information
  • Users - Current user information
  • Devices - Device hardware information
  • Applications - Application discovery and embedding

Accounts API

Access information about the current TelemetryOS account.

Import

import { accounts } from '@telemetryos/sdk';

getCurrent()

Retrieve current account information.

Signature:

async getCurrent(): Promise<{ id: string }>

Returns: Promise resolving to account object

Example:

const account = await accounts().getCurrent();

Users API

Access information about the current user.

Import

import { users } from '@telemetryos/sdk';

getCurrent()

Retrieve current user information.

Signature:

async getCurrent(): Promise<{ id: string }>

Returns: Promise resolving to user object

Example:

const user = await users().getCurrent();

Devices API

Access device hardware information.

Import

import { devices } from '@telemetryos/sdk';

getInformation()

Retrieve hardware information about the current device.

Signature:

async getInformation(): Promise<DeviceInformation>

DeviceInformation Type:

type DeviceInformation = {
  deviceSerialNumber: string;
  deviceModel: string;
  deviceManufacturer: string;
  devicePlatform: string;
}

Returns: Promise resolving to device information

Example:

const info = await devices().getInformation();

Note: Only available on physical devices (not in admin portal)

Applications API

Discover and embed other TelemetryOS applications.

Import

import { applications } from '@telemetryos/sdk';

getAllByMountPoint()

Find all applications with a specific mount point.

Signature:

async getAllByMountPoint(mountPoint: string): Promise<Application[]>

Application Type:

type Application = {
  name: string;
  mountPoints: Record<string, MountPoint>;
}

type MountPoint = {
  path: string;
  [key: string]: any;
}

Parameters:

  • mountPoint - Mount point identifier to search for

Returns: Array of applications with that mount point

Example:

const widgets = await applications().getAllByMountPoint('dashboard-widget');

getByName()

Find a specific application by name.

Signature:

async getByName(name: string): Promise<Application | null>

Parameters:

  • name - Application name

Returns: Application object or null if not found

Example:

const weatherApp = await applications().getByName('weather-widget');

setDependencies()

Declare application dependencies for preloading.

Signature:

async setDependencies(applicationSpecifiers: string[]): Promise<{
  ready: string[];
  unavailable: string[];
}>

Parameters:

  • applicationSpecifiers - Array of application specifier strings

Returns: Object with ready and unavailable arrays

Example:

const result = await applications().setDependencies([
  'weather-widget-hash123',
  'news-ticker-hash456'
]);

Important: Call and await setDependencies() before loading sub-applications in iframes.

Next Steps


What’s Next