Web SDK configuration

class Configuration

Configuration allows you to configure you application.

{
  endpoints: ['wss://ws1.dlg.im'],
  apiAppName: 'Dialog Web App',
  apiAppKey: '156631434b552d39452d5f58334e123834285036',
  toneSound: require('./assets/tone.mp3'),
  ringtoneSound: require('./assets/ringtone.mp3'),
  notificationIcon: require('./assets/favicon.png'),
  notificationSound: require('./assets/notification.mp3'),
  container: document.getElementById('dialog-web-app')
}

Mandatory properties:

endpoints: string[]

WebSocket endpoints. You must specify at least one endpoint.

container: HTMLElement

Application would be rendered in this container.

apiAppName: string

The API application name. User will see this name in sessions list.

apiAppKey: string

The API key.

toneSound: string

Path to the call tone sound file.

ringtoneSound: string

Path to the call ringtone sound file.

notificationIcon: string

Path to the notification icon image file.

notificationSound: string

Path to the notification sound file.

Optional properties:

quiet: boolean = false

Disable all logging. Helpfull for debugging.

history: browserHistory | hashHistory = hashHistory

ReactRouter history object.

createRoutes(store: ReduxStore) => ReactRoute

You can override standard routing using this function.

customReducer: ReduxReducer

Your custom reducer. Will be available in state.custom.

createMiddlewares(messenger: DialogMessenger) => ReduxMiddleware[]

You can add your middlewares to Redux store.

locale: string = navigator.language

Application locale.

messages: LocaleMessages

Custom localisation messages.

{
  en: {
    hello: 'Hello'
  }
}
logger(tag: string, level: string, message: string) => void

Custom logging function. Will be used by Messenger.

asyncStorageName: string = 'dialog'

IndexedDB database name used by Messenger for storing collections.

onRender() => void

This callback will be passed as ReactDOM.render callback.