🎉 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

산업 분야

자동차

항공/우주

금융

게임

메디테크 (MedTech)

IoT

디지털 제품

활용 사례

기업용

개인용

팀용

교육용

주요 특징

하드웨어 및 시스템 통합

ProtoPie MCP

멀티 디바이스 프로토타이핑을 위한 ProtoPie

인터랙션 로직을 위한 ProtoPie

개발자 인수인계

ProtoPie AI

User Testing

제품

Connect Omni

플러그인

Figma

Sketch

Adobe XD

인사이트 & 영감

블로그

eBook

고객 성공 사례

이벤트 및 웨비나

ProtoPie 갤러리

제품 학습 및 지원

프로토파이 스쿨

ProtoPie 다운로드

프로덕트 도큐멘테이션

커뮤니티

산업 분야

자동차

항공/우주

금융

게임

메디테크 (MedTech)

IoT

디지털 제품

활용 사례

기업용

개인용

팀용

교육용

주요 특징

하드웨어 및 시스템 통합

ProtoPie MCP

멀티 디바이스 프로토타이핑을 위한 ProtoPie

인터랙션 로직을 위한 ProtoPie

개발자 인수인계

ProtoPie AI

User Testing

제품

Connect Omni

플러그인

Figma

Sketch

Adobe XD

인사이트 & 영감

블로그

eBook

고객 성공 사례

이벤트 및 웨비나

ProtoPie 갤러리

제품 학습 및 지원

프로토파이 스쿨

ProtoPie 다운로드

프로덕트 도큐멘테이션

커뮤니티

메뉴


Connect Omni 어댑터 및 메시지 연결

어댑터는 실행 중인 앱을 Stage에 연결합니다. 인증, 메시지 전송 및 재연결을 처리합니다. 메시지를 보내고 수신된 메시지에 반응하려면 앱에 고유한 로직이 여전히 필요합니다.

지원되는 언어

AI 코딩 도구를 사용하는 경우 Connect Omni 어댑터 AI 가이드부터 시작하세요. AI 도구는 가이드를 활용하여 프로젝트에 적합한 어댑터 패키지를 선택하고 설치할 수 있습니다.

수동으로 설정하려면 프로젝트의 언어를 선택하고 아래에서 해당하는 패키지를 설치하세요.

언어

일반적인 용도

설치

TypeScript / JavaScript

웹 앱, Node.js

npm install @studioxid/omni-adapter

Python

시뮬레이터 및 스크립트

pip install omni-adapter

C#

Unity 및 .NET

.NET:

dotnet add package StudioXid.OmniAdapter

Unity: NuGetForUnity를 설치한 다음,

StudioXid.OmniAdapter

를 NuGet → Manage NuGet Packages에서 추가하세요.

Dart

Flutter

flutter pub add omni_adapter

Swift

Apple 플랫폼 앱

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

Kotlin

Android 앱

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

이 패키지들은 Connect Omni로 가져오는 것이 아니라 자체 프로젝트에 추가됩니다. 설치 요구 사항 및 지원되는 기능은 언어 및 버전에 따라 다를 수 있습니다.

설치 지침, API 사용법 및 예제는 패키지 문서를 참조하세요:

Unity WebGL 빌드를 Stage에 직접 표시하려면 Stage에 앱 표시하기 → Unity 레이어를 참조하세요. C# 어댑터를 통해 Unity 애플리케이션을 연결하려면 위의 설치 지침을 따르세요.

어댑터 구성

각 앱에는 다음 항목이 필요합니다:

  • Stage에 연결하기 위한 어댑터 키. 환경 변수(CONNECT_TOKEN)나 비밀 관리자(Secret Manager) 등에 안전하게 저장하세요.

  • Backstage에서 앱을 식별하기 위한 어댑터 이름(displayName). 연결을 쉽게 알아볼 수 있도록 명확한 이름을 사용하세요.

앱에서 송수신할 채널을 선언할 수도 있습니다. 이는 Backstage에 표시되지만 기본적으로 메시지 전송을 제한하지는 않습니다. 선언된 채널만 수신하려면 선택적 수신(selective receiving)을 활성화하세요.

기타 선택적 설정에는 대기 인스턴스, 화면 브로드캐스트 및 재연결이 포함됩니다.

메시지 및 채널

각 메시지에는 채널(해당 이름)과 값이 있습니다. 예를 들어 대시보드에서 climate.temperature.request = 23을 전송하면 시뮬레이터가 climate.temperature = 23으로 응답합니다.

  • 값은 문자열, 숫자, 불리언 또는 null일 수 있습니다. 구조화된 데이터는 JSON 문자열로 전송하세요.

  • 콘솔에서 전송된 값은 문자열로 도착합니다. 숫자로 사용하기 전에 앱에서 변환하세요.

  • 기본적으로 앱은 Stage의 다른 참가자로부터 메시지를 수신합니다. 정확히 일치하여 앱이 선언한 채널만 수락하려면 선택적 수신(selective receiving)을 켜세요.

  • 채널을 선언하지 않은 앱도 계속 연결되어 메시지를 교환할 수 있습니다. 단지 Backstage 노드에 채널 칩이 표시되지 않을 뿐입니다.

어댑터 키

  • 공유 → 어댑터 키 → 키 생성에서 키를 만듭니다. 키는 한 번만 표시됩니다.

  • 가능하면 프로그램마다 별도의 키를 사용하세요.

  • 앱이 에디터 없이도 세션을 시작하고 계속 실행할 수 있어야 하는 경우 어댑터가 세션을 시작하도록 허용을 켜세요.

  • 앱이 더 이상 연결되지 않아야 할 때는 키를 취소하세요. 해당 키를 사용하는 앱은 AuthRevoked 오류를 받게 됩니다.

  • 어댑터 키는 프로그램을 연결합니다. 공유 링크는 사람을 초대합니다. 절대 서로 바꿔서 사용하지 마세요.

재연결 및 상태

  • 어댑터는 자동으로 재시도하며, 오프라인 상태인 동안 최대 1,000개의 발신 메시지를 대기열에 보관합니다. 이전에 대기열에 있던 값이 재연결된 후에 도착할 수 있습니다.

  • 세션은 최대 1,000개의 최근 메시지를 유지합니다. 앱은 이 기록을 사용하여 가장 최근에 알려진 값을 복구할 수 있지만, Connect Omni가 상태를 자동으로 복원해 주지는 않습니다. 과거 명령이 새로운 작업으로 다시 실행(replay)되지 않습니다.

  • 새 세션은 빈 상태로 시작됩니다. 재연결하거나 새 세션을 시작한 후 현재 상태를 복원하고 게시하는 것은 각 앱의 책임입니다.

  • 각 프로그램은 초당 최대 60개의 메시지를 보낼 수 있습니다. Connect Omni는 안전이 중요한 제어가 아닌 대화형 테스트를 위해 구축되었습니다.

웹 뷰 통합

웹 뷰 레이어에 표시되는 웹 앱은 브라우저 코드에 어댑터 키를 노출하지 않고도 레이어의 보내기 및 받기 규칙을 통해 메시지를 교환합니다. 설정 방법은 Stage에 앱 표시하기 → 웹 뷰를 참조하세요.

수동 통합 예제: 대시보드 및 시뮬레이터

TypeScript: 대시보드 연결 (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());
}

이 예제는 대시보드의 Node.js 백엔드에서 실행됩니다. requestTemperature()와 수신된 값을 기존 UI 로직에 연결하세요. 브라우저 측 코드에 CONNECT_TOKEN을 노출하지 마세요.

Connect Omni 웹 뷰 레이어 내에 표시되는 브라우저 전용 대시보드의 경우 대신 어댑터의 Engine 프로필을 사용하세요. 자세한 내용은 Stage에 앱 표시하기를 참조하세요.

Python: 시뮬레이터

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

환경 변수에 CONNECT_TOKEN이 구성된 상태로 시뮬레이터를 실행하세요.

이 예제들은 Connect Omni와 메시지를 교환하는 방법을 보여주며, 대시보드의 UI를 직접 구현하지는 않습니다. 송신 및 수신 핸들러를 앱의 컨트롤 및 디스플레이에 연결하세요. 추가 구현 예제는 위에 링크된 패키지 문서를 참조하세요.

두 앱이 모두 실행되면 대시보드의 온도를 변경할 때 climate.temperature.request가 전송됩니다. 시뮬레이터는 요청을 처리하고 확인된 값과 함께 climate.temperature를 게시합니다.