Skip to content
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

[Feature]: Typescript support for the type devs #166

Closed
jaganax opened this issue Jan 8, 2025 · 6 comments
Closed

[Feature]: Typescript support for the type devs #166

jaganax opened this issue Jan 8, 2025 · 6 comments

Comments

@jaganax
Copy link

jaganax commented Jan 8, 2025

What problem are you facing?

I see a challenge as the types support is not there for web sdk and majority of dev ecosystem requires typescript types.

Workarounds

Currently you can define types for the methods you use within your code of your own.

Ideal Solution

Full type support for web sdk.

Other Information

No response

@wesleyorbin
Copy link
Collaborator

Hi @jaganax. Are you using our SDK through npm or our CDN? Our npm package includes the type definitions

@jaganax
Copy link
Author

jaganax commented Jan 13, 2025

Hi @wesleyorbin

thanks for the response, I upgraded to latest web SDK and we are using npm package on nextjs, for dynamic initializaion we could not get global metaType for braze, Is there an way for it?

@davidbielik
Copy link
Collaborator

Hi @jaganax please provide some code samples so we can get a better idea of what you're trying to accomplish. Our SDK includes index.d.ts which contains typescript definitions out of the box.

@jaganax
Copy link
Author

jaganax commented Jan 15, 2025

Thanks @davidbielik, I figured out using typeof for dynamic import. We can close this 👍
let braze: typeof import('@braze/web-sdk')

Updating braze developer guide to use samples to work with 5.6.1 will be more helpful. It still uses 4.4

@davidbielik
Copy link
Collaborator

Thanks @jaganax can you link to where that needs updating and provide a snippet of the context you needed a dynamic import? I'll go ahead and update docs based on that for future developers. Thanks!

@jaganax
Copy link
Author

jaganax commented Jan 24, 2025

My bad realised the documentation is specific to js and not ts. closing this issue

@jaganax jaganax closed this as completed Jan 24, 2025
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

No branches or pull requests

3 participants