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

    Module index

    Server-side Supabase utilities for modern runtimes.

    @supabase/server gives you batteries-included auth and client creation for Edge Functions, Workers, and any server runtime that speaks standard fetch. One import, one line of config — auth is verified, Supabase clients are ready, CORS is handled. Your handler only runs on successful auth.

    import { withSupabase } from '@supabase/server'

    export default {
    fetch: withSupabase({ auth: 'user' }, async (_req, ctx) => {
    const { data: myGames } = await ctx.supabase.from('favorite_games').select()
    return Response.json(myGames)
    }),
    }
    Mode Credential Use case
    "user" Valid JWT Authenticated user endpoints
    "publishable" default publishable key Client-facing, key-validated endpoints
    "secret" default secret key Server-to-server, internal calls
    "none" None Open endpoints

    Bare "publishable" / "secret" match only the default key; use "secret:<name>" for a specific key or "secret:*" to accept any key.

    Array syntax tries modes in order — first match wins:

    withSupabase({ auth: ['user', 'secret'] }, handler)
    

    Adapters for Hono, H3 / Nuxt, Elysia, and NestJS ship inside this package:

    import { withSupabase } from '@supabase/server/adapters/hono'
    import { withSupabase } from '@supabase/server/adapters/h3'
    import { withSupabase } from '@supabase/server/adapters/elysia'
    import { withSupabase, SupabaseCtx } from '@supabase/server/adapters/nestjs'

    For custom flows, all lower-level functions are available from @supabase/server/core:

    import { verifyAuth, createContextClient, createAdminClient } from '@supabase/server/core'
    
    npm install @supabase/server
    # or
    deno add jsr:@supabase/server

    Classes - Errors

    EnvError
    AuthError

    Interfaces - Types

    SupabaseEnv
    Credentials
    AuthResult
    JWTClaims
    UserClaims
    WithSupabaseConfig
    ClientAuth
    CreateContextClientOptions
    CreateAdminClientOptions
    SupabaseContext

    Type Aliases - Types

    AuthMode
    Allow
    AuthModeWithKey
    AllowWithKey

    Variables - Errors

    EnvGenericError
    MissingSupabaseURLError
    MissingPublishableKeyError
    MissingDefaultPublishableKeyError
    MissingSecretKeyError
    MissingDefaultSecretKeyError
    AuthGenericError
    InvalidCredentialsError
    CreateSupabaseClientError
    Errors

    Functions - Middleware

    createSupabaseContext
    withSupabase