smartystreets-js

0.0.3 • Public • Published

smartystreets-js

Build Status Coverage Status npm version Dependency Status License

JS client for SmartyStreets API. Address autocomplete and verification.

Install

npm install --save smartystreets-js

Usage

import smartystreets from 'smartystreets-js';
 
const {
  usStreetSingle,
  usAutocomplete,
  internationalStreetSingle,
} = smartystreets({
  authId: process.env.SMARTYSTREET_AUTH_ID,
  authToken: process.env.SMARTYSTREET_AUTH_TOKEN,
});
 
usStreetSingle({
  street: '3301 South Greenfield Rd',
  city: 'Gilbert',
  state: 'AZ',
  zipcode: '85297',
}).then((res) => {
  console.log(res);
});
 
usAutocomplete({
  prefix: '1600 amphitheatre pkwy',
}).then((res) => {
  console.log(res);
});
 
internationalStreetSingle({
  country: 'Japan',
  address1: 'きみ野 6-1-8',
  locality: '大和市',
  administrative_area: '神奈川県',
  postal_code: '242-0001',
}).then((res) => {
  console.log(res);
});

Package Sidebar

Install

npm i smartystreets-js

Weekly Downloads

5

Version

0.0.3

License

MIT

Last publish

Collaborators

  • joonhocho