Nexmo’s Node.js Server SDK Added Support for Host Overriding

Published January 17, 2020 by Alex Lakatos

We’ve recently released v2.6.0 of our Node.js SDK and added the ability to change the host used for making the HTTP requests.


This feature allows you to override the default hosts, and, in the SDK. One of the most common uses cases for this feature is bypassing the load balancer, and making the HTTP requests towards one of our location-specific Data Centres, for example,

Let’s take a look at our “Make an outbound call with an NCCO” Code Snippet and change it to use the Singapore Data Centre when making the phone call.

Looking closely, the only change we made to the code snippet was adding an options object in the Nexmo instance, with an apiHost property.

Another common use case for this feature is using a proxy or gateway to inspect your requests before they get passed on to the Nexmo API. Let’s use curlhub to inspect all our API traffic.

After you sign up, curlhub gives you a Bucket Id. For example, n43s3qc13thd. That gets appended to any host you want to proxy. So if we want to proxy, the corresponding curlhub host is The same logic applies for, and the corresponding curlhub host is

In order to use those as the proxies for the requests our SDK makes, we’ll have to add the apiHost and restHost properties to our new Nexmo instance.

What’s Next

We’re working on improving our Node.js SDK, and you can track our progress at If you have any suggestions or issues, please feel free to raise them in GitHub or in our community slack.

Leave a Reply

Your email address will not be published.

Get the latest posts from Nexmo’s next-generation communications blog delivered to your inbox.

By signing up to our communications blog, you accept our privacy policy , which sets out how we use your data and the rights you have in respect of your data. You can opt out of receiving our updates by clicking the unsubscribe link in the email or by emailing us at