Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smartystreets-javascript-sdk

Package Overview
Dependencies
Maintainers
7
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smartystreets-javascript-sdk - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

33

examples/us_autocomplete_pro.js

@@ -6,9 +6,9 @@ const SmartySDK = require("smartystreets-javascript-sdk");

// for Server-to-server requests, use this code:
// let authId = process.env.SMARTY_AUTH_ID;
// let authToken = process.env.SMARTY_AUTH_TOKEN;
// const credentials = new SmartyCore.StaticCredentials(authId, authToken);
let authId = "f0fd813a-2c37-2afe-a322-1a46794d6c91";
let authToken = "sPDMxTLaMh8BCp6YWSNW";
const credentials = new SmartyCore.StaticCredentials(authId, authToken);
// for client-side requests (browser/mobile), use this code:
let key = process.env.SMARTY_EMBEDDED_KEY;
const credentials = new SmartyCore.SharedCredentials(key);
// let key = process.env.SMARTY_EMBEDDED_KEY;
// const credentials = new SmartyCore.SharedCredentials(key);

@@ -27,23 +27,8 @@ // The appropriate license values to be used for your subscriptions

let lookup = new Lookup("4770 Lincoln");
lookup.excludeStates = ["CA"];
await handleRequest(lookup, "Simple Lookup");
(async () => {
await handleRequest(lookup, "Simple Lookup");
})()
// *** Using Filter and Prefer ***
lookup = new Lookup("4770 Lincoln");
lookup.maxResults = 10;
lookup.includeOnlyCities = ["Chicago,La Grange,IL", "Blaine,WA"];
lookup.preferStates = ["IL"];
lookup.preferRatio = 33;
lookup.source = "all";
await handleRequest(lookup, "Using Filter and Prefer");
// *** Using 'selected' to Expand Secondaries ***
lookup = new Lookup("4770 Lincoln");
lookup.selected = "4770 N Lincoln Ave Ste 2 (3) Chicago, IL 60625";
await handleRequest(lookup, "Using 'selected' to Expand Secondaries")
// ************************************************

@@ -50,0 +35,0 @@

{
"name": "smartystreets-javascript-sdk",
"version": "2.2.0",
"version": "2.2.1",
"description": "Quick and easy Smarty address validation.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,2 +0,1 @@

const Response = require("./Response");
const Axios = require("axios");

@@ -7,2 +6,3 @@ const {buildSmartyResponse} = require("../src/util/buildSmartyResponse");

constructor(timeout = 10000, proxyConfig, debug = false) {
this.axiosInstance = Axios.create();
this.timeout = timeout;

@@ -38,3 +38,3 @@ this.proxyConfig = proxyConfig;

Axios(requestConfig)
this.axiosInstance(requestConfig)
.then(response => {

@@ -52,3 +52,3 @@ let smartyResponse = buildSmartyResponse(response);

enableDebug() {
Axios.interceptors.request.use(request => {
this.axiosInstance.interceptors.request.use(request => {
console.log('Request:\r\n', request);

@@ -59,3 +59,3 @@ console.log('\r\n*******************************************\r\n');

Axios.interceptors.response.use(response => {
this.axiosInstance.interceptors.response.use(response => {
console.log('Response:\r\n');

@@ -62,0 +62,0 @@ console.log('Status:', response.status, response.statusText);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc