Socket
Book a DemoInstallSign in
Socket

@channel.io/wam-bridge

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@channel.io/wam-bridge

Bridge for Channel.io WAM communication

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
3
Created
Source

@channel.io/wam-bridge

Channel.io WAM(Web App Module) 브릿지 라이브러리입니다. 이 라이브러리는 Channel.io WAM 개발 환경과 WAM Controller 간의 통신을 위한 브릿지 역할을 합니다.

설치

# npm
npm install @channel.io/wam-bridge

# yarn
yarn add @channel.io/wam-bridge

사용법

WAM 개발자를 위한 사용법

로컬 개발 환경에서 WAM 내장 함수를 사용하는 방법:

import { WamBridge } from '@channel.io/wam-bridge';

// 로컬 개발 환경을 위한 브릿지 초기화
const wamBridge = new WamBridge({
  environment: 'local',
  mockResponses: {
    // 목 응답 설정
    callFunction: { success: true, data: { result: '목 응답' } }
  }
});

// 글로벌 객체로 설정
window.ChannelIOWam = wamBridge.getApi();

// 이제 WAM 내장 함수를 사용할 수 있습니다
window.ChannelIOWam.callCommand({ appId: 'test-app', name: 'test-command' });

WAM Controller를 위한 사용법

실제 프로덕션 환경에서 WAM Controller에서 브릿지를 초기화하는 방법:

import { WamBridge } from '@channel.io/wam-bridge';

// 프로덕션 환경을 위한 브릿지 초기화
const wamBridge = new WamBridge({
  environment: 'production',
  // sendToClient 함수 제공
  callbacks: {
    sendToClient: message => {
      // 실제 클라이언트에 메시지 전송
      // 예: window.parent.postMessage(message, '*');
    }
  }
});

// WAM iframe에 주입
wamIframe.contentWindow.ChannelIOWam = wamBridge.getApi();

개발

# 개발 모드 실행
yarn dev

# 빌드
yarn build

# 테스트 실행
yarn test

# 코드 린트
yarn lint

# 코드 포맷팅
yarn format

라이센스

MIT

Keywords

channel.io

FAQs

Package last updated on 25 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts