Minor Changes
-
e964e93: Add SvelteKit 3 support. SvelteKit 2 is still supported.
-
@sveltejs/kit^3.0.0is now an accepted peer dependency. -
SvelteKit 3 only exposes environment variables declared in
src/env.ts. The newclerkEnvVars()export fromsvelte-clerk/envreturns a definition for every variable Svelte Clerk reads, to spread intodefineEnvVars:// src/env.ts import { defineEnvVars } from '@sveltejs/kit/env'; import { clerkEnvVars } from 'svelte-clerk/env'; export const variables = defineEnvVars({ ...clerkEnvVars() });
On SvelteKit 3,
withClerkHandler()now throws an error pointing here when the keys are missing. -
On SvelteKit 3,
<ClerkProvider>navigates withgoto(url, { shallow: true })and thereplaceoption. ThepushState()andreplaceState()functions and thereplaceStateoption it used before are deprecated there. -
When Clerk navigates to a same-origin URL that is not a route in your app,
<ClerkProvider>now falls back to a full page load. SvelteKit 3 rejects those navigations instead of doing this itself. -
On SvelteKit 3, components that use path-based routing need a rest route, such as
src/routes/sign-in/[...rest]. SvelteKit 2 updated the URL for an internal step like/sign-in/factor-onewithout one. SvelteKit 3 loads a 404 page. -
withClerkHandler()no longer depends on theHandletype from@sveltejs/kit, which moved to@sveltejs/kit/hooksin SvelteKit 3. Its return type is assignable to both. -
An environment variable that is declared but unset now falls back to its default instead of
undefined.
-
-
8081e57: Bring environment variables and SDK metadata in line with Clerk's other framework SDKs.
PUBLIC_CLERK_UI_URLandPUBLIC_CLERK_UI_VERSIONset where the Clerk UI script loads from, likePUBLIC_CLERK_JS_URLandPUBLIC_CLERK_JS_VERSIONalready do for clerk-js. The matching__internal_clerkUIUrland__internal_clerkUIVersionprops on<ClerkProvider>now take effect too.CLERK_API_URLandCLERK_API_VERSIONconfigure the Backend API.CLERK_API_VERSIONwas declared inclerkEnvVars()but never read.PUBLIC_CLERK_API_URLandPUBLIC_CLERK_API_VERSIONstill work as fallbacks.<ClerkProvider>andclerkClientnow identify themselves to Clerk assvelte-clerkwith the package version, throughsdkMetadataand the backendUser-Agent. AsdkMetadataprop you pass still wins.