SolidJSS
SolidJSโ€ข4y agoโ€ข
7 replies
XxX_MLG Noob_XxX

Does SolidStart Have a Global `Context` That Server Functions Can Use?

Other SSR frameworks have a concept of a "context" that is globally available to all server functions. For instance, Svelte Kit has event.locals (https://kit.svelte.dev/docs/load#shared-state), which can be set at the server entry point (hooks.server.ts). This context info is then available to all of the server data loaders.

Similarly, Remix passes a context argument to its loader and actions. The value of context can be set by getLoadContext (https://remix.run/docs/en/v1/route/loader#context).

Does SolidStart have anything similar? Or are there at least plans to add something like this in the future? Having a global context is really helpful when it comes to user identifiers.
Was this page helpful?