Skip to content

refactor: overhaul environment handling and server/client architecture - #400

Draft
wobsoriano wants to merge 1 commit into
mainfrom
rob/env-handling
Draft

refactor: overhaul environment handling and server/client architecture#400
wobsoriano wants to merge 1 commit into
mainfrom
rob/env-handling

Conversation

@wobsoriano

Copy link
Copy Markdown
Collaborator
  • Remove all $env/dynamic imports for static adapter support
  • Auto-read process.env in Node environments via withClerkHandler
  • Namespace all Clerk page data under page.data.__clerk (via buildClerkProps)
  • Augment App.PageData with __clerk automatically — zero user boilerplate
  • Simplify root ClerkProvider to spread page.data.__clerk instead of listing all props
  • clerkClient now accepts RequestEvent or App.Locals
  • Remove client-only redirect URLs from middleware (signInForceRedirectUrl etc.) — users configure these directly on
  • Remove __internal_clerkJSUrl/__internal_clerkJSVersion from public ClerkProviderProps matching the React SDK pattern (Omit<IsomorphicClerkOptions, keyof InternalClerkScriptProps>)
  • Properly type localsConfig as ClerkSvelteKitMiddlewareOptions (no Record<string, any> casts)
  • Use as unknown as ClerkOptions for clerk.load() matching the Vue SDK pattern

- Remove all $env/dynamic imports for static adapter support
- Auto-read process.env in Node environments via withClerkHandler
- Namespace all Clerk page data under page.data.__clerk (via buildClerkProps)
- Augment App.PageData with __clerk automatically — zero user boilerplate
- Simplify root ClerkProvider to spread page.data.__clerk instead of listing all props
- clerkClient now accepts RequestEvent or App.Locals
- Remove client-only redirect URLs from middleware (signInForceRedirectUrl etc.)
  — users configure these directly on <ClerkProvider>
- Remove __internal_clerkJSUrl/__internal_clerkJSVersion from public ClerkProviderProps
  matching the React SDK pattern (Omit<IsomorphicClerkOptions, keyof InternalClerkScriptProps>)
- Properly type localsConfig as ClerkSvelteKitMiddlewareOptions (no Record<string, any> casts)
- Use as unknown as ClerkOptions for clerk.load() matching the Vue SDK pattern

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Mar 4, 2026

Copy link
Copy Markdown

Deploy Preview for svelte-clerk ready!

Name Link
🔨 Latest commit 44f486f
🔍 Latest deploy log https://app.netlify.com/projects/svelte-clerk/deploys/69a8b074240d1c000817a12a
😎 Deploy Preview https://deploy-preview-400--svelte-clerk.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Successfully merging this pull request may close these issues.

1 participant