Road Closed

This information is outdated and is no longer maintained. Get the latest!

 

How do I avoid using localhost as the domain with the Javascript API?

Question

Last Updated: March 15, 2013

I'm the developer doing the integration of SmartyStreets for my company. It's pretty much done and I'm happy to say your API made things very easy.

One question I have that I haven't found answered has to do with domains and testing. In order to get the API to work on our development machines I've added "localhost" to the list of domains associated with our authorization token. Obviously we don't want to continue to do that, but we would like for our developers and QA people to be able to run our web application with support for address validation.

The problem is that our development and some testing is done on laptops and they may not be using them from work since people here work from home or work remotely full time so there's no reliable domain to use.

Is there a good way to allow dev access to this feature without leaving our account wide open?

Answer

Excellent question. When we develop an application using our API we setup a testing domain (like "yourdomain.dev" rather than "yourdomain.com"). So, one option would be to setup a test domain to use internally.

A more cumbersome option is to register any and all IP addresses from which development requests could originate (yes, you can register an IP address as well as a domain). Depending on the size of your team and the rate at which IP addresses are changed by ISPs this might not be a practical option.