smartystreets-js

smartystreets-js JS library on GitHub smartystreets-js JS library on npm Download smartystreets-js JS library

JS client for SmartyStreets API. Address autocomplete and verification.

Version 0.0.3 License MIT Vulnerabilities 0
smartystreets-js has no homepage
smartystreets-js JS library on GitHub
smartystreets-js JS library on npm
Download smartystreets-js JS library
Keywords
SmartyStreetsAPInodeclientaddressautocompleteverificationvalidation

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