@@ -3,20 +3,20 @@ import SmartySDK from "smartystreets-javascript-sdk";
33const SmartyCore = SmartySDK . core ;
44const Lookup = SmartySDK . usReverseGeo . Lookup ;
55
6- // for Server-to-server requests, use this code:
7- // let authId = process.env.SMARTY_AUTH_ID;
8- // let authToken = process.env.SMARTY_AUTH_TOKEN;
9- // const credentials = new SmartyCore.StaticCredentials(authId, authToken);
10-
116// for client-side requests (browser/mobile), use this code:
12- let key = process . env . SMARTY_EMBEDDED_KEY ;
13- const credentials = new SmartyCore . SharedCredentials ( key ) ;
7+ // let key = process.env.SMARTY_EMBEDDED_KEY;
8+ // const credentials = new SmartyCore.SharedCredentials(key);
9+
10+ // for Server-to-server requests, use this code:
11+ let authId = process . env . SMARTY_AUTH_ID ;
12+ let authToken = process . env . SMARTY_AUTH_TOKEN ;
13+ const credentials = new SmartyCore . BasicAuthCredentials ( authId , authToken ) ;
1414
1515// The appropriate license values to be used for your subscriptions
1616// can be found on the Subscription page of the account dashboard.
1717// https://www.smarty.com/docs/cloud/licensing
18- let clientBuilder = new SmartyCore . ClientBuilder ( credentials ) . withLicenses ( [ "us-reverse-geocoding-cloud" ] ) ;
19- // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
18+ let clientBuilder = new SmartyCore . ClientBuilder ( credentials ) ;
19+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
2020let client = clientBuilder . buildUsReverseGeoClient ( ) ;
2121
2222let lookup1 = new Lookup ( 40.27644 , - 111.65747 ) ;
0 commit comments