This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetch = require('node-fetch'); | |
| fetch('https://sandbox.bandyer.com/rest/widget/chat/auth/usr_xxxxxx', | |
| { method: 'GET', headers: { 'Content-Type': 'application/json', apikey: 'ak_test_xxxxxxxxxxxx'},}) | |
| .then(res => res.json()) // this is mandatory | |
| .then(json => console.log(json)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BandyerChat.create({ | |
| userAlias: result.id, | |
| appId: Drupal.settings.appIdBandyer, | |
| environment: 'sandbox' | |
| }).then(() => { | |
| BandyerChat.addChat(Drupal.settings.opIdBandyer); | |
| BandyerChat.openWidget(); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This function calls the BandyerChat.logout() method after a specified timeout (default: 5 minutes) | |
| * If BandyerChat widget has not been initialized, the function will throw an error. | |
| * @param timeout | |
| * @param callback | |
| */ | |
| var exitWidgetAfterTimeout = function (timeout, callback) { | |
| if (BandyerChat) { | |
| var delay = timeout || (5* 60 * 1000); | |
| setTimeout(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Client = BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| screenSharingExtensionId: 'id of your screen sharing extension' | |
| }); | |
| BandyerChat.setExtensionUrl('https://chrome.google.com/webstore/detail/your-extension/your-extension-id') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Client = BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| hidden: false, | |
| screenSharingExtensionId: 'id of your screen sharing extension' | |
| }); | |
| Client.on('user_connected',(user) => { | |
| if (user.role === 'group_b'){ // your custom logic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| hidden: false, | |
| screenSharingExtensionId: 'id of your screen sharing extension' | |
| }); | |
| BandyerChat.addChat('usr_test_1').then(() => { | |
| BandyerChat.selectChat('usr_test_1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Client = BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| screenSharingExtensionId: 'id of your screen sharing extension', | |
| mode: 'window' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| layout: { | |
| body: {background: '#fff', color: '#000'}, | |
| dial:{background: '#fff', color: '#000'}, | |
| call: {background: '#C1C6C8', color: '#000'}, | |
| messageSent: {background: '#002453', color: '#fff'}, | |
| messageReceived: {background: '#C1C6C8', color: '#000'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BandyerChat.create({ | |
| userAlias: 'usr_123456', | |
| appId: 'wAppId_fake123456', | |
| environment: 'sandbox', | |
| hidden: false, | |
| screenSharingExtensionId: 'id of your screen sharing extension' | |
| }).then(()=> { | |
| // Widget loaded | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const crypto = require('crypto'); | |
| const data = { | |
| event: "on_message_sent", | |
| "event_version": "0.1", | |
| "namespace": "chat", | |
| "data": "{}" | |
| } | |
| const secret = 'ak_fake_123456789'; | |
| const timestamp = '1554297654628'; |
OlderNewer