1.9.0 • Published 8 months ago

@widgetbot/react-embed v1.9.0

Weekly downloads
768
License
MIT
Repository
github
Last release
8 months ago

react-embed

CodeSandbox

import * as React from 'react'
import WidgetBot, { API } from '@widgetbot/react-embed'

class App extends React.Component {
  api: API

  onAPI(api: API) {
    this.api = api
    api.on('signIn', user => {
      console.log(`Signed in as ${user.name}`, user)
    })
  }

  handleClick() {
    this.api.emit('sendMessage', `Hello world! from \`@widgetbot/react-embed\``)
  }

  render() {
    return (
      <div>
        <button onClick={this.handleClick.bind(this)}>
          {`Send "Hello world"`}
        </button>
        <WidgetBot
          server="299881420891881473"
          channel="355719584830980096"
          onAPI={this.onAPI.bind(this)}
        />
      </div>
    )
  }
}

export default App
1.8.2

9 months ago

1.9.0

8 months ago

1.8.1

9 months ago

1.8.0

9 months ago

1.7.0

1 year ago

1.6.1

1 year ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

3 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago