© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
32 replies
Franck

Warning : Multiple GoTrueClient instances detected in the same browser context

Hello,
I use Supabase in nextjs with next-auth and got the"Multiple GoTrueClient instances..." warning in the console when i want to pass the next-auth bearer token to the supabase client. I have tried multiple ways to implement createClient including context at the root, i checked on github repos, but i'm still stuck...

1 - Singleton Approach. No warning but can't pass the bearer token
"
const client = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY);
const supabase = () => client;
export default supabase;
"

2 - Classic approach. It works but many warnings in the console
"
export const supabaseClient = async (supabaseAccessToken) => {
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
{
global: {
headers: { Authorization:
Bearer ${supabaseAccessToken}
Bearer ${supabaseAccessToken}
},
},
}
);

return supabase;
};
"

Ideally i would like to fetch the token from useSession directly in my supabase client file so that i don't have to pass it as params.
If there is no solution, will this affect performances ? How can i hide this warning ?
Thanks for your help
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Multiple GoTrueClient error
SupabaseSSupabase / help-and-questions
3y ago
Error: Multiple acounts with the same email address in the same linking domain detected: default.
SupabaseSSupabase / help-and-questions
5h ago
Selfhosting Multiple Instances
SupabaseSSupabase / help-and-questions
14mo ago
Multiple simultaneous log in to the same account
SupabaseSSupabase / help-and-questions
13mo ago