-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): export SDK #856
Conversation
In some use cases, the SDK class needs to be instantiated several times. For instance, in a multi-tenancy scenario, there may be multiple instances of the same API server, but serving different data from different base URLs. In this case, we need to instantiate multiple clients with different server URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, thanks so much for this contribution! unfortunately when compiling TS into CJS and ESM, files with both default and non-default exports typically lead to typing issues in certain environments. we don't have great test coverage on this front quite yet unfortunately.
what if the class was the default export from a new src/sdk.ts
file and the IIFE in src/index.ts
imports that?1
Footnotes
Yeah, I saw that discussion after submitting the PR but didn't have time to sort it. Let me take a quick look at it. |
Here are the changes. Once they're good, I'll squash the commits down (or I guess you could do that too if required). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks again, this looks great!
and we'll take care of squashing when we merge, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this!
🧰 Changes
In some use cases, the SDK class needs to be instantiated several times.
For instance, in a multi-tenancy scenario, there may be multiple instances of the same API server, but serving different tenants' data from different base URLs. In this case, we need to instantiate multiple clients with different server URLs.
🧬 QA & Testing
The unit test fixtures have been updated accordingly to reflect that the SDK is now exported.