@widgetbot/embed-api
v1.2.16
Published
WidgetBot embed API
Downloads
16,455
Keywords
Readme
embed-api
import { Client } from '@widgetbot/embed-api'
const api = new Client({
id: 'test',
iframe: document.getElementsByTagName('iframe')[0]
})
api.on('message', message => {
console.log('message:', message.id)
})
api.emit('sendMessage', 'hello world')
import { Server } from '@widgetbot/embed-api'
const api = new Server({ id: 'test' })
api.on('sendMessage', message => {
console.log('sending:', message)
})
api.emit('message', { id: 'testmessage' })