smartystreets-javascript-sdk 5.1.1 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,8 @@ const credentials = new SmartyCore.SharedCredentials(key);
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
17
  const clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["international-autocomplete-v2-cloud"])
18
- // .withBaseUrl("");
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
+
19
20
  const client = clientBuilder.buildInternationalAddressAutocompleteClient();
20
21
 
21
22
  // Documentation for input fields can be found at:
@@ -15,6 +15,8 @@ const credentials = new SmartyCore.SharedCredentials(key);
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
17
  let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["international-global-plus-cloud"]);
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
+
18
20
  let client = clientBuilder.buildInternationalStreetClient();
19
21
 
20
22
  // Documentation for input fields can be found at:
@@ -15,7 +15,8 @@ const credentials = new SmartyCore.SharedCredentials(key);
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
17
  let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-autocomplete-pro-cloud"]);
18
- // .withBaseUrl("");
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
+
19
20
  let client = clientBuilder.buildUsAutocompleteProClient();
20
21
 
21
22
  // Documentation for input fields can be found at:
@@ -15,29 +15,22 @@ const credentials = new SmartyCore.SharedCredentials(key);
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
17
  let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-property-data-principal-cloud"]);
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
+
18
20
  let client = clientBuilder.buildUsEnrichmentClient();
19
- console.log(client);
20
21
 
21
22
  // Documentation for input fields can be found at:
22
23
  // https://www.smarty.com/docs/us-street-api#input-fields
23
24
 
24
- let lookup = new Lookup("7");
25
+ let lookup = new Lookup("334968275");
25
26
 
26
27
  handleResponse(lookup).then();
27
28
 
28
- function handleSuccess(response) {
29
- response.lookups.map(lookup => console.log(lookup.result));
30
- }
31
-
32
- function handleError(response) {
33
- console.log(response);
34
- }
35
-
36
29
  async function handleResponse(lookup) {
37
- try {
38
- const result = await client.sendPrincipal(lookup);
39
- handleSuccess(result);
40
- } catch(err) {
41
- handleError(err);
42
- }
30
+ try {
31
+ const result = await client.sendPrincipal(lookup);
32
+ console.log(result.response);
33
+ } catch (err) {
34
+ console.log(err);
35
+ }
43
36
  }
@@ -12,7 +12,8 @@ let key = process.env.SMARTY_EMBEDDED_KEY;
12
12
  const credentials = new SmartyCore.SharedCredentials(key);
13
13
 
14
14
  let clientBuilder = new SmartyCore.ClientBuilder(credentials);
15
- // .withBaseUrl("");
15
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
16
+
16
17
  let client = clientBuilder.buildUsExtractClient();
17
18
 
18
19
  // Documentation for input fields can be found at:
@@ -15,7 +15,7 @@ const credentials = new SmartyCore.SharedCredentials(key);
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
17
  let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-reverse-geocoding-cloud"]);
18
- // .withBaseUrl("");
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
19
  let client = clientBuilder.buildUsReverseGeoClient();
20
20
 
21
21
  let lookup1 = new Lookup(40.27644, -111.65747, "all");
@@ -14,7 +14,9 @@ const credentials = new SmartyCore.SharedCredentials(key);
14
14
  // The appropriate license values to be used for your subscriptions
15
15
  // can be found on the Subscription page of the account dashboard.
16
16
  // https://www.smarty.com/docs/cloud/licensing
17
- let clientBuilder = new SmartyCore.ClientBuilder(credentials).withBaseUrl("YOUR URL").withLicenses(["us-rooftop-geocoding-cloud"]);
17
+ let clientBuilder = new SmartyCore.ClientBuilder(credentials).withLicenses(["us-rooftop-geocoding-cloud"]);
18
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
19
+
18
20
  let client = clientBuilder.buildUsStreetApiClient();
19
21
 
20
22
  // Documentation for input fields can be found at:
@@ -12,7 +12,8 @@ let key = process.env.SMARTY_EMBEDDED_KEY;
12
12
  const credentials = new SmartyCore.SharedCredentials(key);
13
13
 
14
14
  let clientBuilder = new SmartyCore.ClientBuilder(credentials);
15
- // .withBaseUrl("");
15
+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
16
+
16
17
  let client = clientBuilder.buildUsZipcodeClient();
17
18
 
18
19
  // Documentation for input fields can be found at:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartystreets-javascript-sdk",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Quick and easy Smarty address validation.",
5
5
  "keywords": [
6
6
  "smarty",