Elarian JavaScript SDK
The wrapper provides convenient access to the Elarian APIs.
Documentation
Take a look at the API docs here.
Install
You can install the package from npm by running:
$ npm install elarian
Usage
const Elarian = require('elarian');
const elarian = new Elarian({
apiKey: 'test_api_key',
sandbox: true,
});
const stream = await elarian.StreamNotifications({
app_id: 'test_app'
});
stream.on('data', (notification) => {
console.log(notification);
});
stream.on('end', () => {
});
stream.on('error', (err) => {
console.error(err);
});
stream.on('status', (status) => {
});
Methods
-
AuthToken()
:
-
GetCustomerState()
:
-
AdoptCustomerState()
:
-
AddCustomerReminder()
:
-
AddCustomerReminderByTag()
:
-
CancelCustomerReminder()
:
-
CancelCustomerReminderByTag()
:
-
UpdateCustomerTag()
:
-
DeleteCustomerTag()
:
-
UpdateCustomerSecondaryId()
:
-
DeleteCustomerSecondaryId()
:
-
UpdateCustomerMetadata()
:
-
DeleteCustomerMetadata ()
:
-
SendMessage()
:
-
SendMessageByTag()
:
-
ReplyToMessage()
:
-
MessagingConsent()
:
-
SendPayment()
:
-
CheckoutPayment()
:
-
MakeVoiceCall()
:
-
StreamNotifications()
:
-
SendWebhookResponse()
:
Development
Run all tests:
$ npm install
$ npm test
Issues
If you find a bug, please file an issue on our issue tracker on GitHub.