Skip to content

Conversation

@camiblanch
Copy link
Contributor

@camiblanch camiblanch commented Nov 10, 2025

https://app.clickup.com/t/86b77kdaf

See the clickup task for examples of how this was done in the Go SDK. I also cross referenced the Java SDK to help make sure I was understand the code correctly.

To review you can make sure the tests are running successfully (which you can see here in the PR have passed). You can also run the example code and modify it to use the new methods. When you test the examples a few things need to happen

  1. Make sure you are on this branch
  2. run npm run build or make build (they do the same thing) to compile the SDK
  3. open up /examples/us_street.mjs
  4. change the import at the top to be import SmartySDK from "../dist/esm/index.mjs"; so it references the current changes from the branch, instead of referencing the published one
  5. then setup authentication to the API, I have mine setup to use the auth id and token stored in my zsh environment variables so I uncomment that part of the example file and comment out the embedded keys

function noCredentialsProvided() {
return (!signer) instanceof StaticCredentials || (!signer) instanceof SharedCredentials;
function credentialsProvided() {
return signer instanceof StaticCredentials || signer instanceof SharedCredentials;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this because it was working as a false positive. I also updated it to be the positive condition for readability

@camiblanch camiblanch marked this pull request as ready for review November 11, 2025 18:36
* Adds to the request query to use the component analysis feature.
* @return Returns <b>this</b> to accommodate method chaining.
*/
withFeatureComponentAnalysis() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the error I get for this:

node examples/us_street.mjs
file:///Users/mitchell/Smarty/smartystreets-javascript-sdk/examples/us_street.mjs:21
let client = clientBuilder.buildUsStreetApiClient();
^

TypeError: Cannot read properties of undefined (reading 'buildUsStreetApiClient')
at file:///Users/mitchell/Smarty/smartystreets-javascript-sdk/examples/us_street.mjs:21:28
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)

Node.js v20.18.1

* @return Returns <b>this</b> to accommodate method chaining.
*/
withFeatureComponentAnalysis() {
return this.withCustomCommaSeperatedQuery("features", "component-analysis");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error with this:
`node examples/us_street.mjs
file:///Users/mitchell/Smarty/smartystreets-javascript-sdk/examples/us_street.mjs:21
let client = clientBuilder.buildUsStreetApiClient();
^

TypeError: Cannot read properties of undefined (reading 'buildUsStreetApiClient')
at file:///Users/mitchell/Smarty/smartystreets-javascript-sdk/examples/us_street.mjs:21:28
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)

Node.js v20.18.1`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants