How to use @signalwire/js - 2 common examples

To help you get started, we’ve selected a few @signalwire/js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github signalwire / signalwire-node / packages / js / examples / electron-calling / src / App.js View on Github external
connect() {
    this.setState({ connectStatus: 'Connecting..' })

    this.session = new Relay({
      project: '4b7ae78a-d02e-4889-a63b-08b156d5916e', // Fill in your Project ID here
      token: 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NjQ1ODA0NjMsImlzcyI6IlNpZ25hbFdpcmUgSldUIiwianRpIjoiMFloQU5tZ3BnTnMtYkR2LVZBdUE2LXdVUmZJIiwic2NvcGUiOiJ3ZWJydGMiLCJzdWIiOiI0YjdhZTc4YS1kMDJlLTQ4ODktYTYzYi0wOGIxNTZkNTkxNmUiLCJyZXNvdXJjZSI6ImVsZW5hIiwiZXhwIjoxNTY0NTg3NjYzfQ.pJTJx6dfTlDNg3PZnmKEOBD8rR-oMTtnF5TDwRIRLcFBCEkZCJfO3GU0ZUo9Gi9vS8pSiYPD6zzo7GZt5CI9aQ' // Fill in your JWT here
    })
    this.session.iceServers = [
      { urls: 'stun:stun.l.google.com:19302' }
    ]
    this.session.on('signalwire.ready', session => {
      this.setState({ connectStatus: 'Connected' })
    })

    this.session.on('signalwire.error', error => {
      alert(error.message)
    })

    this.session.on('signalwire.socket.error', error => {
      this.setState({ connectStatus: 'Disconnected' })
github signalwire / signalwire-node / packages / js / examples / react-calling / src / App.js View on Github external
connect(params) {
    setLoginParams(params)

    this.session = new Relay(params)
    this.session.on('signalwire.ready', session => {
      this.setState({ connected: true })
    })
    this.session.on('signalwire.error', error => {
      alert(error.message)
    })

    this.session.on('signalwire.socket.error', error => {
      this.setState({ connected: false })
      this.session.disconnect()
    })

    this.session.on('signalwire.socket.close', error => {
      console.log('close', error)
      this.setState({ connected: false })
      this.session.disconnect()

@signalwire/js

SignalWire JS SDK

MIT
Latest version published 5 months ago

Package Health Score

75 / 100
Full package analysis

Popular @signalwire/js functions