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

    Function createContextClient

    • Creates a Supabase client scoped to the caller's context.

      Configured with a publishable key and (optionally) the caller's JWT, so Row-Level Security policies apply. Stateless — one client per request.

      Type Parameters

      • Database = unknown

      Parameters

      Returns SupabaseClient<Database>

      EnvError If SUPABASE_URL is missing or the specified publishable key is not found.

      const { data: auth } = await verifyAuth(request, { allow: 'user' })
      const supabase = createContextClient({
      auth: { token: auth.token, keyName: auth.keyName },
      })
      const { data } = await supabase.rpc('get_my_items')