Real-time reporting, bidirectional communication, and remote logging for touchpoint devices
- Overview
- Features
- Installation & Quick Start
- Core Modules
- API Documentation
- Examples
- Development
- Support
The Elevation Core library provides comprehensive access to all Elevated Platform core services, enabling seamless integration with the Elevated ecosystem for device management, monitoring, and analytics. Available for both Node.js/NPM and Deno environments.
To interact with the library, developers must acquire an organization token and service endpoint. For more information, please contact Elevation Software at info@elevationsoftware.com.
- Real-time Communication: Bidirectional socket connections for instant device control
- Event Tracking: Comprehensive event system with 200+ predefined event codes
- Centralized Logging: Remote log aggregation with multiple severity levels
- Device Enrollment: Secure device registration and authentication
- Configuration Management: Dynamic configuration updates with location/device overrides
- Content Management: Multi-language CMS with versioning and scheduled content
- Smart Debouncing: Built-in event and log debouncing to prevent flooding
- TouchPoint Management: Device service state management
The core library consists of 7 modules providing comprehensive access to the Elevated Platform Services (EPS):
- Logging - Centralized log aggregation and monitoring
- Events - Event tracking and analytics
- IOT - Real-time bidirectional communication
- Device Enrollment - Device registration and configuration
- Configuration Management - Dynamic configuration with overrides
- Content Management System (CMS) - Multi-language content with versioning
- TouchPoint - Device service state management
npm i @jsr/eai__elevation-core-tsimport { EventCode, EventsClient, LogsClient } from "@jsr/eai__elevation-core-ts";
const url = "https://api-kiosk-elevation.herokuapp.com";
const token = "<Tenant_Access_Token>";
// Create service instances
const events = new EventsClient(url, token);
const logs = new LogsClient(url, token);
// Send a log
await logs.information({ message: "Application started", deviceId: "<Device-GUID>" });
// Send an event
await events.success({ eventCode: EventCode.APP_START });import { EventCode, EventsClient, LogsClient } from "@eai/elevation-core-ts";
const url = "https://api-endpoint";
const token = "your-token";
// Create service instances
const events = new EventsClient(url, token);
const logs = new LogsClient(url, token);
// Send an event
await events.success({
eventCode: EventCode.APP_START,
eventData: { version: "1.0.0" },
});
// Send a log
await logs.information({
message: "Application started",
deviceId: "device-id",
});# build
deno fmt
deno lint
deno task build
# Run tests
deno task testEach service is instantiated directly with new. All accept simple positional arguments — no config objects required.
| Class | Constructor |
|---|---|
LogsClient |
new LogsClient(url, token, timeout?) |
EventsClient |
new EventsClient(url, token, timeout?) |
CMSClient |
new CMSClient(url, token, timeout?) |
ConfigClient |
new ConfigClient(url, token, deviceId, locationId, timeout?) |
EnrollmentClient |
new EnrollmentClient(url, token, fingerPrint, timeout?) |
TouchPointClient |
new TouchPointClient(url, token, fingerPrint, timeout?) |
IOTConnection |
new IOTConnection(url, token, fingerPrint, secondary?) |
Some classes expose optional properties that can be set after construction:
| Class | Property | Type | Description |
|---|---|---|---|
CMSClient |
version |
string? |
CMS content version |
CMSClient |
pageName |
string? |
CMS page filter |
CMSClient |
textReplaces |
{ find: string; replace: string }[]? |
CMS text replacements |
CMSClient |
isDraft |
boolean? |
Use draft content |
ConfigClient |
version |
string? |
Configuration version |
IOTConnection |
appName |
string |
Application name (default: "ElevationDenoService") |
IOTConnection |
appVersion |
string |
Application version (default: "1.0.0") |
EPS provides the facility to centralize all the device's logs within the Administration Panel Interface. Users can access individual device logs through a widget located in the device details page. Logs are displayed in chronological order and can be filtered based on the available log levels.
- Creating a LogsClient
- Multiple Instances
- Sending Logs
- Log Schema
- Log Levels
- Setting Logs Defaults
- Log Helpers
- Log Debounce
import { LogsClient } from "@eai/elevation-core-ts";
const logs = new LogsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");In rare occasions, a developer could have multiple service endpoints and want to simultaneously send logs to all available environments. For that case, create multiple instances.
import { LogsClient } from "@eai/elevation-core-ts";
const logs1 = new LogsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
const logs2 = new LogsClient("https://<prod-url>", "<Tenant_Access_Token>");After creating a LogsClient, you are ready to send log information to EPS.
Each log request should be associated to a unique touchpoint or device, therefore, the use of a deviceId is required.
export interface LogData {
applicationName?: string;
level?: LogLevel;
message: string;
deviceId: string;
url?: string;
body?: string;
statusCode?: number;
}Now in order to send logs, use the message method.
import { LogLevel, LogsClient } from "@eai/elevation-core-ts";
const logs = new LogsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
await logs.message({
applicationName: "MyAwesomeApp",
level: LogLevel.INFO,
message: "Application started",
deviceId: "<Device-GUID>",
url: "Your App url", // optional
body: "Request Body", // optional
statusCode: 0, // optional
});The library supports 4 different log levels:
export enum LogLevel {
INFO = 0,
DELAYED = 1,
ERROR = 2,
CRITICAL = 3,
}To improve productivity, you can set default values for properties that don't change often when sending log messages to EPS.
import { LogLevel, LogOptions, LogsClient } from "@eai/elevation-core-ts";
const logDefaults: LogOptions = {
debounce: 1000 * 10, // 10 seconds debounce time
deviceId: "<Device-GUID>",
applicationName: "MyAwesomeApp",
statusCode: 0,
};
const logs = new LogsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
// setting default values
logs.setDefaults(logDefaults);
// now only pass the information that is not part of the defaults
await logs.message({
level: LogLevel.INFO,
message: "Application started",
});There is one helper method for each LogLevel in the library.
logs.information({ message: "Application started" });
logs.delayed({
url: "https://app_api/submit",
message: "Request took longer than default values",
});
logs.error({ message: "Unable to submit request" });
logs.critical({ message: "Unable to connect to db" });You can define a debounce value in milliseconds. By setting a debounce value, you will prevent the logs library from sending multiple identical log messages within the debounce time window.
import { LogOptions, LogsClient } from "@eai/elevation-core-ts";
const logDefaults: LogOptions = {
debounce: 1000 * 10, // 10 seconds debounce time
deviceId: "<Device-GUID>",
applicationName: "MyAwesomeApp",
statusCode: 0,
};
const logs = new LogsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
logs.setDefaults(logDefaults);
// This is going to be sent
logs.information({ message: "Sending message" });
// This won't reach the server (same message within debounce window)
logs.information({ message: "Sending message" });Events are one of the most important elements of EPS, because they drive the information presented in the Administrator dashboard UI. There are predefined events ready to use in a custom application.
- Creating an EventsClient
- Multiple Instances
- Sending Events
- Events Schema
- Event Codes
- Event Status Codes
- Setting Event Defaults
- Event Helpers
- Event Debounce
import { EventsClient } from "@eai/elevation-core-ts";
const events = new EventsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");For sending events to multiple environments simultaneously, create multiple instances.
import { EventsClient } from "@eai/elevation-core-ts";
const events1 = new EventsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
const events2 = new EventsClient("https://<prod-url>", "<Tenant_Access_Token>");Use the send method to send events to EPS.
export interface EventData {
eventCode?: EventCode | number;
eventType?: EventType;
eventMode?: EventMode;
eventData: EventEventData;
ownerID?: string;
statusCode?: StatusCode;
created?: Date;
metaData?: EventMetadata;
tid?: string;
organization?: string;
}Now you are ready to send an event to EPS.
import { EventCode, EventMode, EventsClient, EventType, StatusCode } from "@eai/elevation-core-ts";
const events = new EventsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
await events.send({
eventCode: EventCode.BAGTAG_PRINT,
eventType: EventType.CHECKIN_KIOSK,
eventMode: EventMode.CUSS,
eventData: { PNR: "ABC123", airline: "AA" },
ownerID: "xxxx-xxxx-xxxx-xxxx", // Device GUID
statusCode: StatusCode.SUCCESS,
});There are over 200 predefined event codes within the library. Developers are also able to create custom event codes through the Administrator UI settings.
Each status code represents a way to filter events in the Administrator UI.
export enum StatusCode {
SUCCESS = 200,
MODE_CHANGE = 300,
FAILURE = 400,
CRITICAL_FAILURE = 500,
INFRACTION = 501,
TIMEOUT = 502,
}You can define default values that are not likely to change when sending events.
Most of the time the values that rarely change are eventMode, eventType, and ownerID.
import { EventMode, EventOptions, EventsClient, EventType } from "@eai/elevation-core-ts";
const defaultValues: EventOptions = {
eventType: EventType.CHECKIN_KIOSK,
eventMode: EventMode.CUSS,
ownerID: "xxxx-xxxx-xxxx-xxxx", // Device GUID
};
const events = new EventsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
events.setDefaults(defaultValues);
// Now just pass what is not in the default values
await events.send({
eventCode: EventCode.BAGTAG_PRINT,
eventData: { PNR: "ABC123", airline: "AA" },
statusCode: StatusCode.SUCCESS,
});The library provides a helper method for each StatusCode type:
events.success({ eventCode: EventCode.BAGTAG_PRINT });
events.failure({ eventCode: EventCode.BAGTAG_PRINT });
events.error({ eventCode: EventCode.OFFLINE });
events.critical({ eventCode: EventCode.OUT_OF_SERVICE });
events.infraction({ eventCode: EventCode.UPPER_DOOR_OPEN });
events.timeout({ eventCode: EventCode.RESERVATION_NOT_FOUND });
events.modeChange({ eventCode: EventCode.MODE_CHANGE });You can define a debounce value in milliseconds on a per eventCode basis. This prevents
the event library from sending multiple events of the specified event-code within the debounce time window.
import { EventCode, EventMode, EventOptions, EventsClient, EventType } from "@eai/elevation-core-ts";
// Debouncing all paper jams to 1 minute
const defaultValues: EventOptions = {
debounceEvent: [{ eventCode: EventCode.PAPER_JAM, debounce: 1000 * 60 }],
eventType: EventType.CHECKIN_KIOSK,
eventMode: EventMode.CUSS,
ownerID: "xxxx-xxxx-xxxx-xxxx",
};
const events = new EventsClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
events.setDefaults(defaultValues);
// This event will be sent
events.error({ eventCode: EventCode.PAPER_JAM });
// This will be debounced
events.error({ eventCode: EventCode.PAPER_JAM });There is a chance that you might want to debounce a particular event only once.
// Debouncing in-service event once for 1 minute
const defaultValues: EventOptions = {
debounceOnce: [{ eventCode: EventCode.IN_SERVICE, debounce: 1000 * 60 }],
};You can also add debounce settings programmatically:
events.addDebounce([
{ eventCode: EventCode.PAPER_JAM, debounce: 60000 },
{ eventCode: EventCode.NETWORK_ERROR, debounce: 30000 },
]);
events.addDebounceOnce([
{ eventCode: EventCode.IN_SERVICE, debounce: 60000 },
]);
// Clear all debounce settings
events.clearDebounce();
// Reset to initial state (clears debounce and defaults)
events.reset();The internet of things, provided by EPS, enables applications running anywhere to establish a bidirectional channel of communication with the Administrator UI. This enables the end user to command the customer facing UI in real time.
IOT requires a url (the full IOT endpoint including namespace), a token, and a fingerPrint.
Without them, the communication between the device and EPS won't be possible.
In order to associate events and logs to specific devices, EPS requires a form of identification that must be unique per device. Many applications use the MAC Address or an auto-generated GUID.
There is a helper function in the core library that facilitates the creation of GUIDs:
import { uuid } from "@eai/elevation-core-ts";
console.log(uuid()); // example response: e91f29b3-3559-491c-ab43-05c63ddc08f9Create an IOTConnection instance with new. The connection is established automatically
upon creation. You can optionally set the application name and version properties.
import { IOTConnection } from "@eai/elevation-core-ts";
const iot = new IOTConnection(
"https://<app-iot-endpoint>/device", // full URL including namespace
"<Tenant_Access_Token>",
"<App-GUID>", // unique per touchpoint
);
// Optionally set app info (defaults: "ElevationDenoService" / "1.0.0")
iot.appName = "airlineCheckinApp";
iot.appVersion = "0.1.0";
// successfully connected to EPS IOT services
iot.on("connected", () => {
console.log("Connection succeeded");
});
// Device configuration is required
iot.on("configurationRequired", () => {
console.log("App configuration must be completed to connect");
});For connecting to multiple IOT environments simultaneously, create multiple instances.
import { IOTConnection } from "@eai/elevation-core-ts";
const iot1 = new IOTConnection("https://<app-iot-endpoint>/device", "<Tenant_Access_Token>", "<App-GUID>");
const iot2 = new IOTConnection("https://<app-iot-endpoint2>/device", "<Tenant_Access_Token>", "<App-GUID>");
iot1.on("connected", () => console.log("Connection 1 succeeded"));
iot2.on("connected", () => console.log("Connection 2 succeeded"));There are several events in the IOT lifecycle:
- connected
- disconnected
- configurationRequired
- command
- flightInfo
- event
- toast
- refresh
- onlineKiosks
- restart
Emitted when the application validates that it is correctly configured and has the correct credentials. After receiving this event, your application is ready to receive commands.
iot.on("connected", () => {
console.log("Connection succeeded, application is ready to receive commands");
});Emitted when the network connection between the application and the EPS IOT service gets disrupted.
iot.on("disconnected", () => {
console.log("Connection was disrupted, application cannot receive commands");
});Emitted when the application connects with a fingerprint never seen before by the IOT service. The application must go through a configuration process.
iot.on("configurationRequired", () => {
console.log("Connection did not succeed, application must go through the configuration process");
});Enables communication between the developer's application and the EPS IOT services through a customizable set of device configuration values.
iot.on("command", (command: Commands) => {
if (command.showBagWaiver) {
console.log("Display waiver to user");
}
});Receives flight information data from the server.
iot.on("flightInfo", (data) => {
console.log("Flight info received:", data);
});Receives event data from the server.
iot.on("event", (data: EventData) => {
console.log("Event received:", data);
});Receives toast notification data from the server.
iot.on("toast", (data) => {
console.log("Toast notification:", data);
});Emitted when a refresh command is received from the server.
iot.on("refresh", () => {
console.log("Refresh requested");
});Receives a list of currently online kiosks.
iot.on("onlineKiosks", (kiosks: OnlineKiosk[]) => {
console.log("Online kiosks:", kiosks);
});Receives print data from the server.
iot.on("print", (data) => {
console.log("Print data received:", data);
});Emitted when a restart command is received from the server.
iot.on("restart", () => {
console.log("Restart requested");
});You can send messages back through the IOT connection:
// Send a typed message
iot.sendMessage("status", { inService: true });
// Send a structured message
iot.send({ type: "status", data: { inService: true } });// Check connection status
const isConnected = iot.getConnectionStatus();
// Get socket ID
const socketId = iot.getSocketId();
// Manually reconnect
iot.reconnect();
// Disconnect
iot.disconnect();
// Destroy (disconnect and remove all listeners)
iot.destroy();In order to identify every single instance of applications/devices across the globe, developers must complete the enrollment process. This can be completed through the Administrator UI or by providing the required information through the library.
- FingerPrint
- Creating an EnrollmentClient
- Multiple Instances
- Starting Enrollment
- Checking for Unique Labels
Similar to the IOT library, in order to configure an instance of the enrollment service, developers must define a unique fingerprint that would identify a particular instance of an application or a physical device anywhere in the world.
import { uuid } from "@eai/elevation-core-ts";
console.log(uuid()); // example response: e91f29b3-3559-491c-ab43-05c63ddc08f9import { EnrollmentClient } from "@eai/elevation-core-ts";
const enrollment = new EnrollmentClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<App-GUID>", // fingerPrint — unique per touchpoint
);For enrolling devices to multiple environments simultaneously, create multiple instances.
import { EnrollmentClient } from "@eai/elevation-core-ts";
const enroll1 = new EnrollmentClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>", "<App-GUID>");
const enroll2 = new EnrollmentClient("https://<api2-url>", "<Tenant_Access_Token>", "<App-GUID>");To start the enrollment process, you will receive the current device object reference which you will use for the enrollment. You also need to retrieve available locations and device specifications.
import { Device, DeviceInfo, DeviceLocation, EnrollmentClient, Specification } from "@eai/elevation-core-ts";
const enrollment = new EnrollmentClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<App-GUID>",
);
// Starting enrollment process
const [device, locations, specs] = await Promise.all([
enrollment.start(),
enrollment.getLocations(),
enrollment.getSpecification(),
]) as [Device, DeviceLocation[], Specification[]];
// Creating a device object for enrollment
const devObj: DeviceInfo = {
label: "DENKIOSK001", // a unique name
device: device,
location: locations[0],
terminal: locations[0]?.terminals[0],
specification: specs[0],
};
await enrollment.enrollDevice(devObj);The library enforces that each enrolled device has a unique name/label. You can validate if a label is available for use before enrolling.
import { EnrollmentClient } from "@eai/elevation-core-ts";
const enrollment = new EnrollmentClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<App-GUID>",
);
const isAvailable = await enrollment.isLabelAvailable("DENKIOSK001");
if (isAvailable) {
console.log("It is ok to use that label");
}The configuration management module allows developers to create custom configurations for their applications. Configurations can be created through the Administrator UI and retrieved by the application. These configurations can be set up as global, location, or device specific through the use of overrides.
- Configuration UI
- Creating a ConfigClient
- Multiple Instances
- Retrieving Configurations
- Fetch and Cache Configurations
import { ConfigClient } from "@eai/elevation-core-ts";
const config = new ConfigClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<Device-GUID>", // deviceId
"<Location-GUID>", // locationId
);
// Optionally set a configuration version
config.version = "2.0";For connecting to multiple configuration management environments, create multiple instances.
import { ConfigClient } from "@eai/elevation-core-ts";
const config1 = new ConfigClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>", "<Device-GUID>", "<Location-GUID>");
const config2 = new ConfigClient("https://<api2-url>", "<Tenant_Access_Token>", "<Device-GUID>", "<Location-GUID>");To retrieve configurations, provide the configuration label. The configurations resolve with priority: device > location > global.
import { ConfigClient } from "@eai/elevation-core-ts";
const config = new ConfigClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<Device-GUID>",
"<Location-GUID>",
);
// Retrieve a single configuration
const value = await config.getConfig("config-key");
// Retrieve a list of configurations
const values = await config.getConfigs(["config-key-1", "config-key-2"]);The fetchAndCacheConfig method fetches a configuration from the server, compares it against a local .jsonc file,
and writes the result to disk if the configuration has changed. It supports backup rotation.
const result = await config.fetchAndCacheConfig({
label: "app-settings",
filePath: "./config/app-settings.jsonc",
force: false, // Optional: force write even if unchanged
maxBackups: 3, // Optional: number of backup files to keep (default: 3)
});
console.log(result.updated); // true if file was written
console.log(result.firstFetch); // true if no prior local file existed
console.log(result.data); // the configuration dataThe CMS module provides a content management system with multi-language support, versioning, scheduled content delivery, and intelligent caching. This enables applications to retrieve localized strings and configuration objects dynamically from the Elevated Platform.
- CMS Overview
- Creating a CMSClient
- Multiple Instances
- Getting Content
- Content Strings
- Configuration Objects
- Language Fallback
- Cache Management
- Version Support
- Draft Mode
The CMS module enables applications to:
- Multi-language Support: Retrieve content in multiple languages with automatic fallback
- Content Versioning: Support for base and custom versions with scheduled display dates
- Configuration Storage: Store and retrieve JSON configuration objects
- Intelligent Caching: In-memory caching with cache control
- Draft/Published States: Support for draft and published content workflows
- Scheduled Content: Display content based on date ranges
- Text Replacements: Automatic find/replace on CMS strings via
textReplacesproperty
import { CMSClient } from "@eai/elevation-core-ts";
const cms = new CMSClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
// Optionally set CMS properties
cms.version = "v2.0";
cms.isDraft = false;For applications that need to access multiple CMS environments simultaneously:
import { CMSClient } from "@eai/elevation-core-ts";
const cms1 = new CMSClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
const cms2 = new CMSClient("https://<prod-url>", "<Tenant_Access_Token>");The CMS provides multiple methods for retrieving content based on your needs.
Use getString() or getKey() to retrieve localized text strings:
import { CMSClient } from "@eai/elevation-core-ts";
// Get a localized string
const welcomeMsg = await cms.getString("welcome_message", "en-US");
console.log(welcomeMsg); // "Welcome to our service"
// Get string in Spanish
const spanishMsg = await cms.getString("welcome_message", "es-ES");
console.log(spanishMsg); // "Bienvenido a nuestro servicio"
// Get string without cache (force fresh data)
const freshMsg = await cms.getString("welcome_message", "en-US", false);Use getKeys() to retrieve multiple localized strings in a single call:
const keys = ["welcome_message", "goodbye_message", "error_message"];
const messages = await cms.getKeys(keys, "en-US");
console.log(messages);
// ["Welcome to our service", "Goodbye!", "An error occurred"]
// Get multiple strings without cache
const freshMessages = await cms.getKeys(keys, "en-US", false);Use getLangs() to retrieve all available language codes from the CMS:
const languages = await cms.getLangs();
console.log(languages); // ["en-US", "es-ES", "fr-FR", "de-DE"]
// Get languages without cache (force fresh data)
const freshLanguages = await cms.getLangs(false);Use getConfig() to retrieve JSON configuration objects that are automatically parsed:
const themeConfig = await cms.getConfig("app_theme_config", "en-US");
console.log(themeConfig);
// {
// primaryColor: "#007bff",
// secondaryColor: "#6c757d",
// fontSize: 16
// }The CMS automatically falls back to en-US when content is not available in the requested language:
// Request content in French
const frenchMsg = await cms.getString("welcome_message", "fr-FR");
// If French version doesn't exist, returns en-US version automaticallyThe CMS includes built-in caching for improved performance.
Pre-load all CMS strings into memory:
// Load all strings with caching
await cms.loadAllStrings();
// Force reload without cache
await cms.loadAllStrings(true);Get information about the current cache state:
const stats = cms.getCacheStats();
console.log(`Cache has ${stats.size} entries`);
console.log(`Cache keys:`, stats.keys);Clear the cache to force fresh data retrieval:
cms.clearCache();Access all loaded strings directly:
const allStrings = cms.getAllStrings();
if (allStrings) {
console.log(`Loaded ${allStrings.length} CMS entries`);
}The CMS supports content versioning. By default, the CMS uses the "base" version, but you can specify a different version using the version property.
import { CMSClient } from "@eai/elevation-core-ts";
const cms = new CMSClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
cms.version = "holiday-2024";
// Content will be retrieved from "holiday-2024" version
const holidayMsg = await cms.getString("welcome_message", "en-US");When a specific version is configured:
- The CMS first looks for the specified version (e.g., "holiday-2024")
- If the version exists but is outside its scheduled display dates, falls back to "base" version
- If the version doesn't exist for a particular key, falls back to "base" version
Versions can have display date ranges. Content is automatically selected based on the current date:
- If a version has
displayDatesdefined, content is only shown within the specified date range - If current date is outside the range, falls back to base version
- This enables time-based content scheduling without code changes
Support for draft content allows testing changes before publishing. Set isDraft to true to retrieve draft (unpublished) content.
import { CMSClient } from "@eai/elevation-core-ts";
const cms = new CMSClient("https://api-kiosk-elevation.herokuapp.com", "<Tenant_Access_Token>");
cms.version = "v2.0";
cms.isDraft = true;
// Retrieves draft content from the specified version
const draftContent = await cms.getString("welcome_message", "en-US");- Draft Mode (
isDraft: true): Returns the latest draft version string directly from the version data - Published Mode (
isDraft: falseor omitted): Returns the last published version from thepublishesarray
When done with the CMS service, clean up resources:
cms.destroy();The TouchPoint module enables applications to manage device service state — setting devices in or out of service and retrieving device information by fingerprint.
import { TouchPointClient } from "@eai/elevation-core-ts";
const touchpoint = new TouchPointClient(
"https://api-kiosk-elevation.herokuapp.com",
"<Tenant_Access_Token>",
"<App-GUID>", // fingerPrint
);Retrieve the complete device information for the configured fingerprint:
const device = await touchpoint.getInfo();
if (device) {
console.log("Device label:", device.label);
console.log("Device location:", device.location);
}Set the device in or out of service:
// Set device in service
await touchpoint.inService(true, "Application started");
// Set device out of service
await touchpoint.inService(false, "Maintenance required");interface EventData {
eventCode?: EventCode | number;
eventType?: EventType;
eventMode?: EventMode;
eventData: EventEventData;
ownerID?: string;
statusCode?: StatusCode;
created?: Date;
metaData?: EventMetadata;
tid?: string;
organization?: string;
}interface LogData {
applicationName?: string;
level?: LogLevel;
message: string;
deviceId: string;
url?: string;
body?: string;
statusCode?: number;
}interface DeviceInfo {
label: string;
device: Device;
location: DeviceLocation;
terminal: Terminal;
specification: Specification;
metadata?: DeviceMetadata;
}import {
CMSClient,
ConfigClient,
EnrollmentClient,
EventCode,
EventMode,
EventsClient,
EventType,
IOTConnection,
LogsClient,
TouchPointClient,
} from "@eai/elevation-core-ts";
async function main() {
const url = Deno.env.get("ELEVATION_SERVICE_ENDPOINT")!;
const token = Deno.env.get("ELEVATION_TOKEN")!;
const fingerPrint = Deno.env.get("ELEVATION_FINGERPRINT")!;
const iotUrl = Deno.env.get("ELEVATION_IOT_ENDPOINT")!;
// Create service instances
const events = new EventsClient(url, token);
const logs = new LogsClient(url, token);
// Set defaults
events.setDefaults({
eventType: EventType.CHECKIN_KIOSK,
eventMode: EventMode.NATIVE,
ownerID: fingerPrint,
});
logs.setDefaults({
deviceId: fingerPrint,
applicationName: "MyKioskApp",
});
// Configure IOT
const iot = new IOTConnection(iotUrl, token, fingerPrint);
iot.appName = "MyKioskApp";
iot.appVersion = "1.0.0";
iot.on("connected", () => {
console.log("IOT Connected");
events.success({ eventCode: EventCode.ONLINE });
});
iot.on("command", (command) => {
console.log("Received command:", command);
if (command.refresh) {
console.log("Refreshing application...");
}
});
// Send startup events and logs
await events.success({
eventCode: EventCode.APP_START,
eventData: { version: "1.0.0" },
});
await logs.information({
message: "Application started successfully",
});
// TouchPoint service state
const touchpoint = new TouchPointClient(url, token, fingerPrint);
await touchpoint.inService(true, "Application started");
console.log("Elevation library initialized successfully!");
}
main().catch(console.error);const events = new EventsClient(url, token);
events.setDefaults({
debounceEvent: [
{ eventCode: EventCode.PAPER_JAM, debounce: 60000 },
{ eventCode: EventCode.NETWORK_ERROR, debounce: 30000 },
],
debounceOnce: [
{ eventCode: EventCode.IN_SERVICE, debounce: 60000 },
],
});const config = new ConfigClient(url, token, "<Device-GUID>", "<Location-GUID>");
// Retrieve a configuration
const settings = await config.getConfig("theme_settings");
// Fetch and cache to disk
const result = await config.fetchAndCacheConfig({
label: "app-settings",
filePath: "./config/app-settings.jsonc",
});elevation-core-ts/
├── lib/ # Core library modules
│ ├── shared/ # Base classes & utilities
│ ├── events.ts # Event tracking (EventsClient)
│ ├── logs.ts # Centralized logging (LogsClient)
│ ├── iot.ts # WebSocket communication (IOTConnection)
│ ├── enrollment.ts # Device registration (EnrollmentClient)
│ ├── config.ts # Configuration management (ConfigClient)
│ ├── cms.ts # Content management (CMSClient)
│ └── touchpoint.ts # Device service state (TouchPointClient)
├── types/ # TypeScript definitions & enums
├── mod.ts # Main library exports
└── deno.json # Deno configuration
# Build
deno task build
# Run tests
deno task testCreate a .env file for local development:
ELEVATION_TOKEN=your_tenant_access_token
ELEVATION_SERVICE_ENDPOINT=https://api-kiosk-elevation.herokuapp.com
ELEVATION_IOT_ENDPOINT=wss://iot-elevation.herokuapp.com
ELEVATION_FINGERPRINT=device-unique-idFor support and questions:
- Contact: Elevation Software
- Issues: GitHub Issues
- Documentation: API Docs
BUSL-1.1 - Elevation Software
Built by Elevation Software

