SDK Method Reference

Complete reference for all TelemetryOS SDK methods

SDK Method Reference

@telemetryos/sdk - Complete reference for all TelemetryOS SDK methods.

Overview

The TelemetryOS SDK enables developers to build applications that run on digital signage devices, kiosks, and displays managed by the TelemetryOS platform. Applications are built using standard web technologies (HTML, CSS, JavaScript/TypeScript) and can access platform features through a simple JavaScript API.

Current Version: 1.7.4

Installation

npm install @telemetryos/sdk

Basic Usage

import { configure, store } from '@telemetryos/sdk';

// Initialize SDK
configure('my-app-name');

// Use storage methods
await store().instance.set('setting', 'value');
const value = await store().instance.get('setting');

// Subscribe to changes
store().instance.subscribe('setting', (newValue) => {
  console.log('Setting changed:', newValue);
});

Package Exports

Main Functions

configure(applicationName: string): void
destroy(): void
globalClient(): Client | null

Message Handling (Advanced)

on(name: string, handler: MessageHandler): void
once(name: string, handler: MessageHandler): void
off(name: string, handler?: MessageHandler): void
send(name: string, data: any): void
request<T>(name: string, data: any): Promise<T>
subscribe(name: string, key: any, handler: MessageHandler): Promise<SubscriptionResult>
unsubscribe(name: string, key: any, handler?: MessageHandler): Promise<SubscriptionResult>

Resource Methods

store(): Store                    // Multi-scope data storage
applications(): Applications      // Application discovery
media(): Media                    // Media library access
playlist(): Playlist              // Playlist navigation
overrides(): Overrides            // Content overrides
accounts(): Accounts              // Account information
users(): Users                    // User information
devices(): Devices                // Device information
proxy(): Proxy                    // External content proxy
weather(): Weather                // Weather data and forecasts

Classes (Re-exported)

Accounts, Applications, Devices, Environment, Media, Store, Users

Version

telemetrySdkVersion: string       // Current SDK version

Core Methods

Storage Methods

The Storage Methods provide four storage scopes for data persistence:

  • application - Shared across all instances of your application
  • instance - Specific to the current application instance
  • device - Only on the current physical device
  • shared(namespace) - Inter-application communication

View Storage Methods Documentation

Client Methods

Low-level message passing methods for advanced use cases. Most developers should use the higher-level resource methods instead.

View Client Methods Documentation

Content Methods

Media Methods

Access TelemetryOS media library content including images and videos. Query by folders, tags, or individual media items.

View Media Methods Documentation

Playlist Methods

Control Studio playlist navigation. Advance pages, go back, or dynamically adjust page duration.

View Playlist Methods Documentation

Overrides Methods

Manage content overrides for emergency alerts and priority content that interrupts normal playlist flow.

View Overrides Methods Documentation

Platform Methods

Platform Methods

Access to platform features:

  • Accounts - Current account information
  • Users - Current user information
  • Devices - Device hardware information
  • Applications - Application discovery and embedding
  • Proxy - External content fetching with CORS handling

View Platform Methods Documentation

External Data Methods

Proxy Methods

Fetch external content with automatic CORS handling:

  • Proxy Fetch - Access any external API or resource
  • Intelligent Caching - Platform-level caching across device fleets
  • Bandwidth Management - Optimize network usage at scale

View Proxy Methods Documentation

Weather Methods

Access weather data and forecasts:

  • Current Conditions - Real-time weather for any location
  • Daily Forecast - Multi-day weather predictions
  • Hourly Forecast - Hour-by-hour weather data

View Weather Methods Documentation

Quick Links

Most Used Methods

External Data

Advanced Methods

Common Patterns

Loading and Subscribing to Data

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

// Load initial value
const value = await store().instance.get('setting');

// Subscribe to changes
store().instance.subscribe('setting', (newValue) => {
  console.log('Setting changed:', newValue);
});

Displaying Media

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

// Get media by tag
const images = await media().getAllByTag('marketing');

// Display first image
const img = document.createElement('img');
img.src = images[0].publicUrls[0];

Controlling Playlists

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

// Advance to next page after 30 seconds
setTimeout(async () => {
  await playlist().nextPage();
}, 30000);

TypeScript Support

All methods include full TypeScript definitions:

import { store, media, type MediaContent } from '@telemetryos/sdk';

// Types are inferred
const value = await store().instance.get<string>('key');

// Or use exported types
const mediaItems: MediaContent[] = await media().getAllByTag('featured');

Error Handling

All SDK operations can throw errors or timeout (30 seconds):

try {
  await store().instance.set('key', 'value');
} catch (error) {
  console.error('Operation failed:', error);
  // Provide fallback or user feedback
}

Browser Compatibility

The SDK works in all modern browsers. Applications are embedded as iframes and use standard web APIs.

Support

Next Steps