-
Notifications
You must be signed in to change notification settings - Fork 0
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
Svelte/SvelteKit official sdk support #23
Comments
@tore-statsig what do you think? |
Right now we are focused on support for Flutter/dart and elixir/erlang, but we can look into Svelte after those! It does look like the LaunchDarkly link your provided just gives some direction around how to use their js client sdk and node-js server sdk with the svelte framework, so this shouldnt require a new SDK. For now, I think you should be able to follow similar steps with Statsig in terms of initializing the SDK and using it on the client side with Svelte. I think our SSR steps/using SvelteKit will differ more. |
Gotcha. Yea we are currently using SvelteKit and it was actually pretty finicky to get the hybrid (CSR/SSR) solution working correctly (especially with the sveltekit's load function). So for now, we are thinking of doing SSR only and hydrating down to CSR until we can think of a better solution. |
Did you look at the statsig SSR info for the node sdk? The node server SDK has a function that will generate the initialize values for a user: https://docs.statsig.com/server/nodejsServerSDK#ssr And then the js-client sdk takes that in. Right now, we only document the flow for react, but the react SDK just uses our js sdk internally. Here's the call to set the values for the client SDK https://github.com/statsig-io/react-sdk/blob/main/src/StatsigSynchronousProvider.tsx#L62 |
Was able to get something implemented but it was definitely a bit complex to get working. Feel free to close, but might be worth having it be opened for official support? (at least documentation) |
Yeah we will keep it open for now. Glad you got something working! |
With Svelte also gaining some popularity, it would be nice to see some official documentation around Svelte (or the nextJS equivalent sveltekit). Svelte should be pretty straightforward, but sveltekit might be a bit more tricky as it can both be SSR/CSR similar to NextJS.
As a reference, LaunchDarkly currenlty does have an official tutorial/sdk on svelte/sveltekit (https://docs.launchdarkly.com/guides/platform-specific/svelte)
The text was updated successfully, but these errors were encountered: