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.
- package/examples/international_address_autocomplete.js +2 -1
- package/examples/international_street.js +2 -0
- package/examples/us_autocomplete_pro.js +2 -1
- package/examples/us_enrichment.js +9 -16
- package/examples/us_extract.js +2 -1
- package/examples/us_reverse_geo.js +1 -1
- package/examples/us_street.js +3 -1
- package/examples/us_zipcode.js +2 -1
- package/package.json +1 -1
|
@@ -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("
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
}
|
package/examples/us_extract.js
CHANGED
|
@@ -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");
|
package/examples/us_street.js
CHANGED
|
@@ -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).
|
|
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:
|
package/examples/us_zipcode.js
CHANGED
|
@@ -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:
|