0.0.3 • Published 7 years ago

smartystreets-js v0.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

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);
});