# Supabase Third-Party Auth Integration

Clerk is now supported as a [Supabase third-party authentication provider](https://supabase.com/docs/guides/auth/third-party/clerk). This first-class integration allows Supabase to accept Clerk-signed session tokens, removing the need to create a custom JWT template and generate a specific token when interacting with Supabase's APIs.

Now, all you need to do is pass Clerk's session token to Supabase's client:

```ts
import { createClient } from '@supabase/supabase-js'
import { auth } from '@clerk/nextjs/server'

const supabase = createClient(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
  {
    async accessToken() {
      return (await auth()).getToken()
    },
  },
)
```

## Enable the integration

To get started with Clerk and Supabase:

1. Visit the [Clerk dashboard](https://dashboard.clerk.com/setup/supabase) and go through the setup flow
2. Copy your Clerk instance domain into Supabase's [Third-party auth settings](https://supabase.com/dashboard/project/_/auth/third-party)

For more information, visit the [Supabase Integration documentation page](https://clerk.com/docs/integrations/databases/supabase.md). We can't wait to see what you build with Clerk and Supabase!
