[GH-ISSUE #2235] Passkeys do not work in expo apps #9109

Closed
opened 2026-04-13 04:26:51 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @rdmchr on GitHub (Apr 12, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2235

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Create a simple better-auth backend and a simple expo app
  2. Install the passkeys plugin in both parts
  3. Try registering a passkey in the expo app

Current vs. Expected behavior

Currently you get this error:

{"message": "WebAuthn is not supported in this browser", "status": 500, "statusText": "INTERNAL_SERVER_ERROR"}

Passkeys have been supported by both Android and iOS for many versions and there even seems to be a react-native-passkeys implementation (https://www.npmjs.com/package/react-native-passkey).

What version of Better Auth are you using?

1.2.5

Provide environment information

- OS: Android 15 (API 35) using the Pixel 8a emulator
- Server: NextJS 14

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)

//server
export const auth = betterAuth({
	baseURL: env.BASE_URL,
	secret: env.BETTER_AUTH_SECRET,
	trustedOrigins: [env.BASE_URL, "carol://"],
	database: drizzleAdapter(db, {
		provider: "pg",
		schema: schema,
	}),
	plugins: [passkey(), expo()],
	session: { expiresIn: 1000 * 60 * 60 * 24 * 30 },
	emailAndPassword: {
		enabled: true,
		requireEmailVerification: true,
	},
	emailVerification: {
		sendOnSignUp: false,
	},
});



//client
export const authClient = createAuthClient({
	baseURL: getBaseUrl(),
	plugins: [
		expoClient({
			scheme: "carol",
			storagePrefix: "carol",
			storage: SecureStore,
		}),
		passkeyClient(),
	],
});

Additional context

No response

Originally created by @rdmchr on GitHub (Apr 12, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2235 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Create a simple better-auth backend and a simple expo app 2. Install the passkeys plugin in both parts 3. Try registering a passkey in the expo app ### Current vs. Expected behavior Currently you get this error: ``` {"message": "WebAuthn is not supported in this browser", "status": 500, "statusText": "INTERNAL_SERVER_ERROR"} ``` Passkeys have been supported by both Android and iOS for many versions and there even seems to be a react-native-passkeys implementation (https://www.npmjs.com/package/react-native-passkey). ### What version of Better Auth are you using? 1.2.5 ### Provide environment information ```bash - OS: Android 15 (API 35) using the Pixel 8a emulator - Server: NextJS 14 ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript //server export const auth = betterAuth({ baseURL: env.BASE_URL, secret: env.BETTER_AUTH_SECRET, trustedOrigins: [env.BASE_URL, "carol://"], database: drizzleAdapter(db, { provider: "pg", schema: schema, }), plugins: [passkey(), expo()], session: { expiresIn: 1000 * 60 * 60 * 24 * 30 }, emailAndPassword: { enabled: true, requireEmailVerification: true, }, emailVerification: { sendOnSignUp: false, }, }); //client export const authClient = createAuthClient({ baseURL: getBaseUrl(), plugins: [ expoClient({ scheme: "carol", storagePrefix: "carol", storage: SecureStore, }), passkeyClient(), ], }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 04:26:51 -05:00
Author
Owner

@iosazee commented on GitHub (Apr 15, 2025):

use expo-passkey plugin which provides a way to use platform specific biometric authentication for expo apps.

<!-- gh-comment-id:2804669697 --> @iosazee commented on GitHub (Apr 15, 2025): use [expo-passkey](https://www.npmjs.com/package/expo-passkey) plugin which provides a way to use platform specific biometric authentication for expo apps.
Author
Owner

@Bekacru commented on GitHub (May 6, 2025):

Passkey plugin is only meant for browsers

<!-- gh-comment-id:2853149317 --> @Bekacru commented on GitHub (May 6, 2025): Passkey plugin is only meant for browsers
Author
Owner

@kevcube commented on GitHub (Sep 3, 2025):

I made a plugin which wraps passkey plugin and adds native bindings to android and iOS! Maintains all functionality of existing passkey function. https://github.com/kevcube/expo-better-auth-passkey

<!-- gh-comment-id:3248788935 --> @kevcube commented on GitHub (Sep 3, 2025): I made a plugin which wraps passkey plugin and adds native bindings to android and iOS! Maintains all functionality of existing passkey function. https://github.com/kevcube/expo-better-auth-passkey
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9109