nextauthjs/next-auth · error · TypeError
Provider id "${provider}" does not refer to a WebAuthn provi
Error message
Provider id "${provider}" does not refer to a WebAuthn provider.
Please use `import { signIn } from "@auth/sveltekit/client"` instead. What it means
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.
Source
Thrown at packages/frameworks-sveltekit/src/lib/webauthn.ts:79
authorizationParams?: SignInAuthorizationParams
): Promise<SignInResponse>
export async function signIn<Redirect extends boolean = true>(
provider?: ProviderId,
options?: SignInOptions<Redirect>,
authorizationParams?: SignInAuthorizationParams
): Promise<SignInResponse | void> {
const { callbackUrl, ...rest } = options ?? {}
const {
redirectTo = callbackUrl ?? window.location.href,
redirect = true,
...signInParams
} = rest
const baseUrl = base ?? ""
if (!provider || provider !== "webauthn") {
// TODO: Add docs link with explanation
throw new TypeError(
[
`Provider id "${provider}" does not refer to a WebAuthn provider.`,
'Please use `import { signIn } from "@auth/sveltekit/client"` instead.',
].join("\n")
)
}
const webAuthnBody: Record<string, unknown> = {}
const webAuthnResponse = await webAuthnOptions(provider, signInParams)
if (webAuthnResponse.error) {
logger.error(new Error(await webAuthnResponse.error.text()))
return
}
webAuthnBody.data = JSON.stringify(webAuthnResponse.data)
webAuthnBody.action = webAuthnResponse.action
const signInUrl = `${baseUrl}/callback/${provider}?${new URLSearchParams(authorizationParams)}`
const res = await fetch(signInUrl, {View on GitHub (pinned to a1a16a5a77)
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".
Example fix
// before
import { signIn } from "@auth/sveltekit/webauthn"
await signIn("github") // TypeError
// after
import { signIn } from "@auth/sveltekit/client"
await signIn("github")
// or, for passkeys:
await signIn("webauthn") Defensive patterns
Strategy: validation
Validate before calling
if (provider !== "webauthn") {
throw new TypeError("Server-side webauthn signIn only accepts provider id 'webauthn'; use @auth/sveltekit/client for other providers")
} Type guard
function isWebAuthnProvider(provider: string): provider is "webauthn" {
return provider === "webauthn"
} Try / catch
try {
await signIn("webauthn", { /* action: 'register' | 'authenticate' */ })
} catch (err) {
if (err instanceof TypeError && err.message.includes("does not refer to a WebAuthn provider")) {
console.error("Wrong signIn module — import signIn from '@auth/sveltekit/client' for non-passkey providers")
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Provider id "${provider}" does not refer to a WebAuthn provi
- Provider id "${provider}" refers to a WebAuthn provider. Ple
- Authenticator not found.
- Authenticator not found.
- Authenticator not found.
AI-assisted analysis of nextauthjs/next-auth@a1a16a5a77 (2026-08-28).
Data as JSON: /api/errors/b75834f8c935bb95.
Report an issue: GitHub.