๐ŸŽ‰ Black Friday: 40% off Pro Yearly with code PRO40. Check the full offer here

๐ŸŽ‰ Black Friday: 40% off Pro Yearly with code PRO40. Check the full offer here

๐ŸŽ‰ Black Friday: 40% off Pro Yearly with code PRO40. Check the full offer here

INDUSTRIES

Automotive

Aviation

Finance

Gaming

MedTech

IoT

Digital Products

USE CASES

For Enterprise

For Individuals

For Teams

For education

ProtoPie Feature

Hardware & System Integration

ProtoPie MCP

Multi-Device Prototyping

Interaction Logic

Developer Handoff

ProtoPie AI

User Testing

FAMILY PRODUCTS

Connect Omni

STUDIO PLUGINS

Figma

Sketch

Adobe XD

INSIGHTS & INSPIRATION

Blog

eBooks

Clients Success Stories

Events & Webinars

ProtoPie Gallery

PRODUCT LEARNING & SUPPORT

ProtoPie School

Download ProtoPie

Product Documentation

Community

INDUSTRIES

Automotive

Aviation

Finance

Gaming

MedTech

IoT

Digital Products

USE CASES

For Enterprise

For Individuals

For Teams

For education

ProtoPie Feature

Hardware & System Integration

ProtoPie MCP

Multi-Device Prototyping

Interaction Logic

Developer Handoff

ProtoPie AI

User Testing

FAMILY PRODUCTS

Connect Omni

STUDIO PLUGINS

Figma

Sketch

Adobe XD

INSIGHTS & INSPIRATION

Blog

eBooks

Clients Success Stories

Events & Webinars

ProtoPie Gallery

PRODUCT LEARNING & SUPPORT

ProtoPie School

Download ProtoPie

Product Documentation

Community

Menu


Connect Omni Adapters & Messages

An Adapter connects a running app to a Stage. It handles authentication, message delivery, and reconnection. Your app still needs its own logic to send messages and react to the ones it receives.

Supported languages

If youโ€™re using an AI coding tool, start with the Connect Omni Adapter AI guide. Your AI tool can use the guide to choose and install the appropriate Adapter package for your project.

For manual setup, choose your projectโ€™s language and install the corresponding package below.

Language

Typical use

Install

TypeScript / JavaScript

Web apps, Node.js

npm install @studioxid/omni-adapter

Python

Simulators and scripts

pip install omni-adapter

C#

Unity and .NET

.NET:

dotnet add package StudioXid.OmniAdapter

Unity: Install NuGetForUnity, then add

StudioXid.OmniAdapter

from NuGet โ†’ Manage NuGet Packages.

Dart

Flutter

flutter pub add omni_adapter

Swift

Apple platform apps

.package(url: "<https://github.com/ProtoPie/omni-adapter-swift>", from: "0.1.0") (Swift Package Manager)

Kotlin

Android apps

implementation("com.studioxid:omni-adapter:0.1.0") (Gradle)

These packages are added to your own project, not imported into Connect Omni. Installation requirements and supported features may vary by language and release.

For installation instructions, API usage, and examples, refer to the package documentation:

To display a Unity WebGL build directly on the Stage, see Showing Apps on the Stage โ†’ Unity Layer. To connect a Unity application through the C# Adapter, use the installation instructions above.

Configure the Adapter

Each app needs:

  • An Adapter Key to connect to a Stage. Store it securely, such as in an environment variable (CONNECT_TOKEN) or secret manager.

  • An Adapter Name (displayName) to identify the app in Backstage. Use a distinct name to make connections easier to recognize.

You can also declare the channels your app sends and receives. These appear in Backstage but donโ€™t restrict message delivery by default. To receive only declared channels, enable selective receiving.

Other optional settings cover standby instances, screen broadcast, and reconnection.

Messages and channels

Each message has a channel (its name) and a value. For example, the dashboard sends climate.temperature.request = 23 and the simulator replies with climate.temperature = 23.

  • Values can be strings, numbers, booleans, or null. Send structured data as a JSON string.

  • Values sent from the Console arrive as strings. Convert them in your app before you use them as numbers.

  • By default, an app receives messages from the other participants on the Stage. Turn on selective receiving to accept only the channels the app declares, matched exactly.

  • An app that doesnโ€™t declare channels still connects and exchanges messages. Its Backstage node just shows no channel chips.

Adapter Keys

  • Create a key in Share โ†’ Adapter keys โ†’ Create key. Itโ€™s shown only once.

  • Use a separate key for each program where you can.

  • Turn on Let adapters start a session if the app should be able to start and keep a Session running without an Editor.

  • Revoke a key when an app should no longer connect. Apps using it get AuthRevoked.

  • Adapter Keys connect programs. Share links invite people. Never use one in place of the other.

Reconnecting and state

  • The Adapter retries automatically and queues up to 1,000 outgoing messages while itโ€™s offline. Older queued values may arrive after it reconnects.

  • A Session keeps up to 1,000 recent messages. Apps can use this history to recover the latest known values, but Connect Omni doesnโ€™t automatically restore their state. Past commands arenโ€™t replayed as new actions.

  • A new Session starts empty. Each app is responsible for restoring and publishing its current state after reconnecting or starting a new Session.

  • Each program can send up to 60 messages per second. Connect Omni is built for interactive testing, not safety-critical control.

Web View integration

A web app displayed in a Web View Layer exchanges messages through the Layerโ€™s Send and Receive rules, without exposing an Adapter Key in browser code. For setup, see Showing Apps on the Stage โ†’ Web View.

Manual integration example: Dashboard and simulator

TypeScript: Dashboard connection (Node.js)

import { connect } from '@studioxid/omni-adapter';

const client = await connect({
  secretKey: process.env.CONNECT_TOKEN!,
  displayName: 'smart-home-dashboard',
  sends: ['climate.temperature.request'],
  receives: ['climate.temperature'],
});

// Receive the confirmed temperature.
client.on('climate.temperature', (msg) => {
  console.log('Confirmed temperature:', msg.value);
  // Update the dashboard through your app's UI logic.
});

// Call this from your server-side handler
// when the user changes the temperature.
export async function requestTemperature(value: number) {
  await client.send('climate.temperature.request', value);
}

client.on('error', (err) => {
  console.error(`[${err.code}] ${err.hint ?? err.message}`);
});

for (const signal of ['SIGINT', 'SIGTERM'] as const) {
  process.once(signal, () => void client.close());
}
import { connect } from '@studioxid/omni-adapter';

const client = await connect({
  secretKey: process.env.CONNECT_TOKEN!,
  displayName: 'smart-home-dashboard',
  sends: ['climate.temperature.request'],
  receives: ['climate.temperature'],
});

// Receive the confirmed temperature.
client.on('climate.temperature', (msg) => {
  console.log('Confirmed temperature:', msg.value);
  // Update the dashboard through your app's UI logic.
});

// Call this from your server-side handler
// when the user changes the temperature.
export async function requestTemperature(value: number) {
  await client.send('climate.temperature.request', value);
}

client.on('error', (err) => {
  console.error(`[${err.code}] ${err.hint ?? err.message}`);
});

for (const signal of ['SIGINT', 'SIGTERM'] as const) {
  process.once(signal, () => void client.close());
}
import { connect } from '@studioxid/omni-adapter';

const client = await connect({
  secretKey: process.env.CONNECT_TOKEN!,
  displayName: 'smart-home-dashboard',
  sends: ['climate.temperature.request'],
  receives: ['climate.temperature'],
});

// Receive the confirmed temperature.
client.on('climate.temperature', (msg) => {
  console.log('Confirmed temperature:', msg.value);
  // Update the dashboard through your app's UI logic.
});

// Call this from your server-side handler
// when the user changes the temperature.
export async function requestTemperature(value: number) {
  await client.send('climate.temperature.request', value);
}

client.on('error', (err) => {
  console.error(`[${err.code}] ${err.hint ?? err.message}`);
});

for (const signal of ['SIGINT', 'SIGTERM'] as const) {
  process.once(signal, () => void client.close());
}
import { connect } from '@studioxid/omni-adapter';

const client = await connect({
  secretKey: process.env.CONNECT_TOKEN!,
  displayName: 'smart-home-dashboard',
  sends: ['climate.temperature.request'],
  receives: ['climate.temperature'],
});

// Receive the confirmed temperature.
client.on('climate.temperature', (msg) => {
  console.log('Confirmed temperature:', msg.value);
  // Update the dashboard through your app's UI logic.
});

// Call this from your server-side handler
// when the user changes the temperature.
export async function requestTemperature(value: number) {
  await client.send('climate.temperature.request', value);
}

client.on('error', (err) => {
  console.error(`[${err.code}] ${err.hint ?? err.message}`);
});

for (const signal of ['SIGINT', 'SIGTERM'] as const) {
  process.once(signal, () => void client.close());
}
import { connect } from '@studioxid/omni-adapter';

const client = await connect({
  secretKey: process.env.CONNECT_TOKEN!,
  displayName: 'smart-home-dashboard',
  sends: ['climate.temperature.request'],
  receives: ['climate.temperature'],
});

// Receive the confirmed temperature.
client.on('climate.temperature', (msg) => {
  console.log('Confirmed temperature:', msg.value);
  // Update the dashboard through your app's UI logic.
});

// Call this from your server-side handler
// when the user changes the temperature.
export async function requestTemperature(value: number) {
  await client.send('climate.temperature.request', value);
}

client.on('error', (err) => {
  console.error(`[${err.code}] ${err.hint ?? err.message}`);
});

for (const signal of ['SIGINT', 'SIGTERM'] as const) {
  process.once(signal, () => void client.close());
}

This example runs on the dashboardโ€™s Node.js backend. Connect requestTemperature() and the received value to your existing UI logic. Do not expose CONNECT_TOKEN in browser-side code.

For a browser-only dashboard displayed inside a Connect Omni Web View Layer, use the Adapterโ€™s Engine profile instead. See Showing Apps on the Stage.

Python: Simulator

import asyncio
import os
import omni_adapter

async def main():
    client = await omni_adapter.connect(
        secret_key=os.environ["CONNECT_TOKEN"],
        display_name="smart-home-simulator",
        receives=["climate.temperature.request"],
        sends=["climate.temperature"],
    )

    temperature = 22.0
    stop = asyncio.Event()

    @client.on("climate.temperature.request")
    async def on_request(msg):
        nonlocal temperature

        try:
            temperature = float(msg.value)
        except (TypeError, ValueError):
            print("Invalid temperature:", msg.value)
            return

        print("Temperature updated:", temperature)
        await client.send("climate.temperature", temperature)

    client.on("error", lambda err: print(
        f"[{err.code}] {err.hint or err.message}"
    ))

    with omni_adapter.stop_on_signals(stop.set):
        try:
            # Publish the initial state.
            await client.send("climate.temperature", temperature)
            await stop.wait()
        finally:
            await client.close()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass
import asyncio
import os
import omni_adapter

async def main():
    client = await omni_adapter.connect(
        secret_key=os.environ["CONNECT_TOKEN"],
        display_name="smart-home-simulator",
        receives=["climate.temperature.request"],
        sends=["climate.temperature"],
    )

    temperature = 22.0
    stop = asyncio.Event()

    @client.on("climate.temperature.request")
    async def on_request(msg):
        nonlocal temperature

        try:
            temperature = float(msg.value)
        except (TypeError, ValueError):
            print("Invalid temperature:", msg.value)
            return

        print("Temperature updated:", temperature)
        await client.send("climate.temperature", temperature)

    client.on("error", lambda err: print(
        f"[{err.code}] {err.hint or err.message}"
    ))

    with omni_adapter.stop_on_signals(stop.set):
        try:
            # Publish the initial state.
            await client.send("climate.temperature", temperature)
            await stop.wait()
        finally:
            await client.close()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass
import asyncio
import os
import omni_adapter

async def main():
    client = await omni_adapter.connect(
        secret_key=os.environ["CONNECT_TOKEN"],
        display_name="smart-home-simulator",
        receives=["climate.temperature.request"],
        sends=["climate.temperature"],
    )

    temperature = 22.0
    stop = asyncio.Event()

    @client.on("climate.temperature.request")
    async def on_request(msg):
        nonlocal temperature

        try:
            temperature = float(msg.value)
        except (TypeError, ValueError):
            print("Invalid temperature:", msg.value)
            return

        print("Temperature updated:", temperature)
        await client.send("climate.temperature", temperature)

    client.on("error", lambda err: print(
        f"[{err.code}] {err.hint or err.message}"
    ))

    with omni_adapter.stop_on_signals(stop.set):
        try:
            # Publish the initial state.
            await client.send("climate.temperature", temperature)
            await stop.wait()
        finally:
            await client.close()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass
import asyncio
import os
import omni_adapter

async def main():
    client = await omni_adapter.connect(
        secret_key=os.environ["CONNECT_TOKEN"],
        display_name="smart-home-simulator",
        receives=["climate.temperature.request"],
        sends=["climate.temperature"],
    )

    temperature = 22.0
    stop = asyncio.Event()

    @client.on("climate.temperature.request")
    async def on_request(msg):
        nonlocal temperature

        try:
            temperature = float(msg.value)
        except (TypeError, ValueError):
            print("Invalid temperature:", msg.value)
            return

        print("Temperature updated:", temperature)
        await client.send("climate.temperature", temperature)

    client.on("error", lambda err: print(
        f"[{err.code}] {err.hint or err.message}"
    ))

    with omni_adapter.stop_on_signals(stop.set):
        try:
            # Publish the initial state.
            await client.send("climate.temperature", temperature)
            await stop.wait()
        finally:
            await client.close()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass
import asyncio
import os
import omni_adapter

async def main():
    client = await omni_adapter.connect(
        secret_key=os.environ["CONNECT_TOKEN"],
        display_name="smart-home-simulator",
        receives=["climate.temperature.request"],
        sends=["climate.temperature"],
    )

    temperature = 22.0
    stop = asyncio.Event()

    @client.on("climate.temperature.request")
    async def on_request(msg):
        nonlocal temperature

        try:
            temperature = float(msg.value)
        except (TypeError, ValueError):
            print("Invalid temperature:", msg.value)
            return

        print("Temperature updated:", temperature)
        await client.send("climate.temperature", temperature)

    client.on("error", lambda err: print(
        f"[{err.code}] {err.hint or err.message}"
    ))

    with omni_adapter.stop_on_signals(stop.set):
        try:
            # Publish the initial state.
            await client.send("climate.temperature", temperature)
            await stop.wait()
        finally:
            await client.close()

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass

Run the simulator with CONNECT_TOKEN configured in its environment.

These examples show how to exchange messages with Connect Omni; they do not implement your dashboardโ€™s UI. Connect the send and receive handlers to your appโ€™s controls and display. For additional implementation examples, see the package documentation linked above.

Once both apps are running, changing the dashboardโ€™s temperature should send climate.temperature.request. The simulator processes the request and publishes climate.temperature with the confirmed value.