@supabase/server - v0.2.0
    Preparing search index...

    Function extractCredentials

    • Extracts authentication credentials from an incoming HTTP request.

      Reads two headers:

      • Authorization: Bearer <token> → extracted as token
      • apikey: <key> → extracted as apikey

      This is a pure extraction step — no validation or verification is performed. Pass the result to verifyCredentials to validate against allowed auth modes.

      Parameters

      • request: Request

        The incoming HTTP request.

      Returns Credentials

      The extracted Credentials. Fields are null when the corresponding header is absent.

      import { extractCredentials } from '@supabase/server/core'

      const creds = extractCredentials(request)
      console.log(creds.token) // "eyJhbGci..." or null
      console.log(creds.apikey) // "sb-abc123-publishable-..." or null