Exporting client utils from index #2455
Replies: 1 comment
-
There isn't a built-in codegen option to automatically export createClient or createConfig from the generated index.ts. The generated client utilities are available in the ./client module and are used in client.gen.ts to create the client instance, but they're not re-exported by default from the SDK entry point see docs. The typical approach is to manually re-export these utilities in your package's index.ts after generation, like: export { createClient, createConfig } from './client'; This makes them available to consumers of your bundled SDK. Just keep in mind you'll need to repeat this step if you regenerate the SDK and your index.ts is overwritten. If you want to automate this, consider scripting the export step as part of your build process. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @dosu,
Is there a way to export createClient, createConfig from the generated index.ts file? We are bundling our generated SDK into a package whose index file is the entry point and currently do not have a way to import the client utility functions.
Beta Was this translation helpful? Give feedback.
All reactions