Enabling renaming event params from camelCase to snake_case and vice versa
bridge
.disableRenameParams()
Enabling logs.
bridge
.enableLogs()
Enabling renaming event params from camelCase to snake_case and vice versa
bridge
.enableRenameParams()
Set callback function to handle events without ref (notifications for example).
bridge.onReceive(({ type, handler, payload }) => {
// Handle event data
console.log('event', type, handler, payload)
})
Send event and wait response from express client.
bridge
.sendClientEvent(
{
method: 'get_weather',
params: {
city: 'Moscow',
},
}
)
.then(data => {
// Handle response
console.log('response', data)
})
Send event and wait response from express client.
bridge
.sendClientEvent(
{
method: 'get_weather',
params: {
city: 'Moscow',
},
}
)
.then(data => {
// Handle response
console.log('response', data)
})
Generated using TypeDoc
Disabling logs.