Elarian
A framework that helps you build scalable, personalized customer engagement applications.
Install
You can install the package from npm by running:
$ npm install elarian@latest
Usage
const { initializeClient } = require('elarian');
const client = await initializeClient({
apiKey: 'YOUR_API_KEY',
orgId: 'YOUR_ORG_ID',
appId: 'YOUR_APP_ID',
});
client.on('receivedMessage', (data, customer) => {
});
const customer = await client.initializeCustomer({ number: '+XXXXXXXXXXXX', provider: 'cellular' });
const state = await customer.getState();
console.log(state);
await customer.updateMetadata({ name: 'alice', age: 25 });
const { name } = await customer.getMetadata();
await customer.sendMessage({ number: 'MyAPP', channel: 'sms' }, { body: { text: `Hi ${name}, how are you?` }});
See example for a full sample app.
Documentation
Take a look at the product documentation. For detailed info on this SDK, see the reference.
Development
Run all tests:
$ npm install
$ npm test
See SDK Spec for reference.
Issues
If you find a bug, please file an issue on our issue tracker on GitHub.
Known Issues
resumable
connection options prevents app from connecting