Using Unleash with Svelte SSR #9094
-
I'm currently working on integrating Unleash with Svelte. I followed your documentation on how to integrate it on the client-side. Now I'm facing the problem on how to integrate it on the server side. For example, in my +page.server.ts, I want to check the status of a flag. For this, I'm expecting a global unleash instance to be created on server startup, but I'm unable to find documentation for this. Is anyone able to assist with this issue? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @JE4GLE, can you add more details on what you're trying to achieve here? Is it rendering different pages based on the value of a feature flag or do you have something else in mind? |
Beta Was this translation helpful? Give feedback.
Oh... If that's the problem it might be related to https://github.com/Unleash/unleash-client-node/blob/2e59c9645b4bee1320bbd4448a5736f3849432c1/src/unleash.ts#L93-L97
This is a feature we've built to help notify users about potential mis-configurations, which was a recurring topic. And we didn't have a case were you'd need two clients (perhaps we should differentiate between frontend and backend clients 🤔). But if that's the issue you're facing, you can disable that check from the configuration of Unleash: https://github.com/Unleash/unleash-client-node/blob/2e59c9645b4bee1320bbd4448a5736f3849432c1/src/unleash-config.ts#L35