Invalid Callback URL on expo IOS when doing Google oauth

Hello everyone,

I’m trying out Better Auth and I’m running into an issue with my google oauth.

Error:
2025-04-12T14:00:21.709Z ERROR [Better Auth]: Invalid callbackURL: business-copilot:///
2025-04-12T14:00:22.223Z INFO [Better Auth]: If it's a valid URL, please add business-copilot:/// to trustedOrigins in your auth config
 Current list of trustedOrigins: exp://,http://localhost:8081
 ERROR  {"code": "INVALID_CALLBACKURL", "message": "Invalid callbackURL", "status": 403, "statusText": ""}


package version:
"@better-auth/expo": "^1.2.6-beta.8",
"better-auth": "1.2.6-beta.6",



Relevant code:

app.json
"scheme": "business-copilot",


auth.ts
trustedOrigins: ['exp://'],
socialProviders: {
  google: {
    clientId: process.env.GOOGLE_CLIENT_ID as string,
    clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
  },
},


authClient.ts
export const authClient = createAuthClient({
  baseURL:
    process.env.BETTER_AUTH_URL /* base url of your Better Auth backend. */,
  disableDefaultFetchPlugins: true,
  plugins: [
    expoClient({
      scheme: 'business-copilot',
      storage: SecureStore,
    }),
    organizationClient(),
    anonymousClient(),
    phoneNumberClient(),
  ],
});


Sign-in.tsx
const onGoogleButtonPress = useCallback(async () => {
  const { error, data } = await authClient.signIn.social({
    provider: 'google',
    callbackURL: '/recent-businesses',
  });
  if (error) {
    console.error(error);
  }
}, []);


Behaviour:
Web: works as expected
On iOS (and android I guess): throws error relating to the scheme

Please can someone help me out. I would very much appreciate
Solution
add business-copilot:/// as a trusted origin in your auth config
Was this page helpful?