The server-side javascript SDK implements all common endpoints, webhooks, and an HTTP client so that you can focus more on business logic.
We ourselves use Amio API on projects where messaging is necessary. We always ended up writing lots of boilerplate code for every new project that got copy pasted all the time. It was more than natural that we ended up compiling all that reapeted code to an SDK. Since we mostly use javascript as a server-side language, our first SDK is written in it.
// without SDK
request('GET', '/v1/channels/{{channel_id}}/contacts/{{contact_id}}/messages')
// with SDK
amioApi.messages.list({{channel_id}}, {{contact_id}})
// without SDK
function routeEvents(event, data) {
switch(event) {
'message_received': handleMessageReceived(data); break;
'messages_delivered': handleMessagesDelivered(data); break;
// ...
}
}
// with SDK
amioWebhookRouter.onMessageReceived(handleMessageReceived)
amioWebhookRouter.onMessagesDelivered(handleMessagesDelivered)
We're observing repeating patterns in our code-bases. In next releases, we'll probably add some shortcut methods like sendTextMessage(), sendImageMessage() and some builders for structred messages messageBuilder().addButton().addTitle()
As always we'll be glad for any comments or suggestions you report.
Let the SDK simplify your development!
Amio.io Team
Book a 30-minute session where we will find out how AI bot can help you decrease call center costs, increase online conversion, and improve customer experience.
Book a demoBook a 30-min consultation session where we will discuss your support cost optimization potential, experience improvements, including our online conversion increase techniques
Request a demo