Better-Auth jwtClient() plugin shows ERROR when used with expoClient().

Here is our authClientConfiguration:
import { expoClient } from "@better-auth/expo/client";
import { jwtClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import * as SecureStore from "expo-secure-store";
export const authClient = createAuthClient({
baseURL: "https://**********/auth-service", // Base URL of your Better Auth backend.
plugins: [
expoClient({
scheme: "betterauthexpo",
storagePrefix: "betterauthexpo",
storage: SecureStore,
}),
jwtClient(),
]
});
import { expoClient } from "@better-auth/expo/client";
import { jwtClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import * as SecureStore from "expo-secure-store";
export const authClient = createAuthClient({
baseURL: "https://**********/auth-service", // Base URL of your Better Auth backend.
plugins: [
expoClient({
scheme: "betterauthexpo",
storagePrefix: "betterauthexpo",
storage: SecureStore,
}),
jwtClient(),
]
});
This configuration shows [TypeError: Cannot read property 'subtle' of undefined] error when loaded with expo go android. I am very new to better-auth and currently we are stuck here. We need the jwt token from our auth-service, to send request to our main-backend. Note we have enabled expo in our backend with jwt plugin. If we omit the jwtClient() in the expo frontend everything starts working fine. Thanks in advance. A detailed screenshot of logs is also added
No description
1 Reply
LightTab2
LightTab22mo ago
Which version of BetterAuth are you on?

Did you find this page helpful?