{"record":{"id":"b75834f8c935bb95","repo":"nextauthjs/next-auth","slug":"provider-id-provider-does-not-refer-to-a-weba","errorCode":null,"errorMessage":"Provider id \"${provider}\" does not refer to a WebAuthn provider.\nPlease use `import { signIn } from \"@auth/sveltekit/client\"` instead.","messagePattern":"Provider id \"(.+?)\" does not refer to a WebAuthn provider\\.\nPlease use `import (.+?) from \"@auth/sveltekit/client\"` instead\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/frameworks-sveltekit/src/lib/webauthn.ts","lineNumber":79,"sourceCode":"  authorizationParams?: SignInAuthorizationParams\n): Promise<SignInResponse>\nexport async function signIn<Redirect extends boolean = true>(\n  provider?: ProviderId,\n  options?: SignInOptions<Redirect>,\n  authorizationParams?: SignInAuthorizationParams\n): Promise<SignInResponse | void> {\n  const { callbackUrl, ...rest } = options ?? {}\n  const {\n    redirectTo = callbackUrl ?? window.location.href,\n    redirect = true,\n    ...signInParams\n  } = rest\n\n  const baseUrl = base ?? \"\"\n\n  if (!provider || provider !== \"webauthn\") {\n    // TODO: Add docs link with explanation\n    throw new TypeError(\n      [\n        `Provider id \"${provider}\" does not refer to a WebAuthn provider.`,\n        'Please use `import { signIn } from \"@auth/sveltekit/client\"` instead.',\n      ].join(\"\\n\")\n    )\n  }\n\n  const webAuthnBody: Record<string, unknown> = {}\n  const webAuthnResponse = await webAuthnOptions(provider, signInParams)\n  if (webAuthnResponse.error) {\n    logger.error(new Error(await webAuthnResponse.error.text()))\n    return\n  }\n  webAuthnBody.data = JSON.stringify(webAuthnResponse.data)\n  webAuthnBody.action = webAuthnResponse.action\n\n  const signInUrl = `${baseUrl}/callback/${provider}?${new URLSearchParams(authorizationParams)}`\n  const res = await fetch(signInUrl, {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/frameworks-sveltekit/src/lib/webauthn.ts#L61-L97","documentation":"SvelteKit's non-client webauthn helper (lib/webauthn.ts signIn) validates that the requested provider id is exactly \"webauthn\" and throws a TypeError otherwise, telling developers to use the client entry point (@auth/sveltekit/client) instead. This module is for server-side WebAuthn flows; generic OAuth/email sign-ins are handled by the client signIn, so passing the wrong provider id here is a programming mistake the guard catches early.","triggerScenarios":"Calling the server-side signIn (from @auth/sveltekit/webauthn) with a provider id other than \"webauthn\" — e.g. passing \"github\", \"credentials\", an email provider id, or leaving the provider argument undefined — when the intent was to start a passkey sign-in.","commonSituations":"Developers migrating from the client signIn API import the wrong module and reuse existing provider ids; or they call the webauthn helper without arguments expecting it to default to passkeys; or copy-pasted sign-in code paths for OAuth flows.","solutions":["Pass the literal provider id \"webauthn\" to this server-side signIn.","If signing in with a non-passkey provider, import signIn from \"@auth/sveltekit/client\" instead.","Check your import: @auth/sveltekit/webauthn (server, passkeys only) vs @auth/sveltekit/client (browser, all providers).","Ensure the WebAuthn provider is registered in your auth config with id \"webauthn\"."],"exampleFix":"// before\nimport { signIn } from \"@auth/sveltekit/webauthn\"\nawait signIn(\"github\") // TypeError\n// after\nimport { signIn } from \"@auth/sveltekit/client\"\nawait signIn(\"github\")\n// or, for passkeys:\nawait signIn(\"webauthn\")","handlingStrategy":"validation","validationCode":"if (provider !== \"webauthn\") {\n  throw new TypeError(\"Server-side webauthn signIn only accepts provider id 'webauthn'; use @auth/sveltekit/client for other providers\")\n}","typeGuard":"function isWebAuthnProvider(provider: string): provider is \"webauthn\" {\n  return provider === \"webauthn\"\n}","tryCatchPattern":"try {\n  await signIn(\"webauthn\", { /* action: 'register' | 'authenticate' */ })\n} catch (err) {\n  if (err instanceof TypeError && err.message.includes(\"does not refer to a WebAuthn provider\")) {\n    console.error(\"Wrong signIn module — import signIn from '@auth/sveltekit/client' for non-passkey providers\")\n  }\n}","preventionTips":["Only import the webauthn module's signIn for passkey flows.","Use @auth/sveltekit/client's signIn for all other providers in browser code.","Keep provider ids centralized to avoid typos.","Add a unit test asserting the server-side signIn rejects non-webauthn ids."],"tags":["webauthn","sveltekit","wrong-api","typeerror"],"backgroundTag":"wrong-provider-signin","analyzedSha":"a1a16a5a7780488c7449feece410033f445d0b31","analyzedAt":"2026-08-28T21:52:38.200Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}