Access token from Social Login

I am migrating from Supabase. Everything works well until I tried to find out how can I get the provider token (from Google) after a successful login. I am using more roles on login and then after I want to use the token to authenticate to some Gmail APIs.

I tried to get on
authClient.useSession
and
authClient.listAccounts()
. Is there a way?

I am using Hono on backend and React with Vite on frontend.

In Supabase you could get from their session. More info about it and specifically what I want: https://supabase.com/docs/guides/auth/social-login#provider-tokens
Logging in with social accounts
Solution
Better Auth doesn't expose the provider tokens on the client. You can make an endpoint and fetch the accounts table.
Was this page helpful?