@supabase/server - v1.9.2
    Preparing search index...

    Function fromSupabaseUrl

    • Points authorizationServer at a Supabase project's Auth issuer.

      Use this off Supabase Edge Functions, where the app's own origin is unrelated to the Supabase project's, so the issuer cannot be derived from the request.

      Parameters

      • supabaseUrl: string

        The project URL, e.g. https://<ref>.supabase.co (the same value passed to createClient()).

      Returns string

      import { withOAuthProtectedResource, fromSupabaseUrl } from '@supabase/server'

      withOAuthProtectedResource(
      {
      resourceServer: (req) => new URL(req.url).origin + '/api/mcp',
      authorizationServer: fromSupabaseUrl('https://abc123.supabase.co'),
      },
      handler,
      )