@@ -15,21 +15,23 @@ const credentials = new SmartyCore.SharedCredentials(key);
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-rooftop-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+ . withLicenses ( [ "us-rooftop-geocoding-cloud" ] )
20+ . withFeatureComponentAnalysis ( ) ;
21+ // .withBaseUrl("YOUR URL") // withBaseUrl() should be used if you are self-hosting the Smarty API
2022
2123let client = clientBuilder . buildUsStreetApiClient ( ) ;
2224
2325// Documentation for input fields can be found at:
2426// https://www.smarty.com/docs/us-street-api#input-fields
2527
2628let lookup1 = new Lookup ( ) ;
27- lookup1 . inputId = "24601" ; // Optional ID from your system
29+ lookup1 . inputId = "24601" ; // Optional ID from your system
2830lookup1 . addressee = "John Doe" ;
2931lookup1 . street = "330 N 100 W" ;
3032lookup1 . street2 = "closet under the stairs" ;
3133lookup1 . secondary = "APT 2" ;
32- lookup1 . urbanization = "" ; // Only applies to Puerto Rico addresses
34+ lookup1 . urbanization = "" ; // Only applies to Puerto Rico addresses
3335lookup1 . city = "Provo" ;
3436lookup1 . state = "Utah" ;
3537lookup1 . zipCode = "84601" ;
@@ -58,7 +60,7 @@ batch.add(lookup3);
5860await handleResponse ( batch ) ;
5961
6062function handleSuccess ( response ) {
61- response . lookups . map ( lookup => console . log ( lookup . result ) ) ;
63+ response . lookups . map ( ( lookup ) => console . log ( lookup . result ) ) ;
6264}
6365
6466function handleError ( response ) {
@@ -69,7 +71,7 @@ async function handleResponse(lookup) {
6971 try {
7072 const result = await client . send ( lookup ) ;
7173 handleSuccess ( result ) ;
72- } catch ( err ) {
74+ } catch ( err ) {
7375 handleError ( err ) ;
7476 }
75- }
77+ }
0 commit comments