supabase-auth

supabase-auth is a skill for Claude Code from textura-agency/next16-claude-starter. It costs 82 tokens per session (1,320 once invoked), scanned A, original, Unlicense.

Instructions for adding Supabase Auth, a user-account system, to a Next.js 16 application. They cover browser and server clients, session refresh, protected routes, and sign-in flows.

In plain words
What is it for?
Use it when adding accounts, login, protected pages, client portals, or other content that only signed-in users should access in a Next.js 16 app.
Why use it?
They provide the project structure and decisions needed for login and gated content without piecing the integration together from separate examples. They also explain the Next.js 16 change from middleware.ts to proxy.ts.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when adding accounts, login, protected pages, client portals, or other content that only signed-in users should access in a Next.js 16 app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/textura-agency/next16-claude-starter/supabase-auth
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add textura-agency/next16-claude-starter --skill supabase-auth
Clone the repo
git clone --depth 1 https://github.com/textura-agency/next16-claude-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for supabase-auth

README.md
[![agentmods](https://agentmods.dev/badge/skills/textura-agency/next16-claude-starter/supabase-auth/github.svg)](https://agentmods.dev/skills/textura-agency/next16-claude-starter/supabase-auth)
Your own site
<a href="https://agentmods.dev/skills/textura-agency/next16-claude-starter/supabase-auth"><img src="https://agentmods.dev/badge/skills/textura-agency/next16-claude-starter/supabase-auth/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for supabase-auth

Your own site · 80×15
<a href="https://agentmods.dev/skills/textura-agency/next16-claude-starter/supabase-auth"><img src="https://agentmods.dev/badge/skills/textura-agency/next16-claude-starter/supabase-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,320 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.01320
Opus 5 $0.00041 $0.00660
Sonnet 5 $0.00016 $0.00264
Haiku 4.5 $0.00008 $0.00132

Measured 13d ago against content hash 0a96c0c86f26, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

supabase-auth scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/supabase-auth/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase Auth in Next.js 16

Only reach for this if the project genuinely needs user accounts. A marketing site backed by Payload does not — Payload has its own admin auth, and adding Supabase Auth on top is pure complexity.

Verified 2026-08 against @supabase/ssr 0.12.4.

The Next.js 16 wrinkle

middleware.ts no longer exists — it is proxy.ts, exporting a function named proxy, running on Node (the Edge runtime is gone and cannot be configured). Next's guidance is the "thin proxy" pattern: cheap cookie checks and redirects only. Session refresh is fine there; heavy authorisation is not.

yarn add @supabase/supabase-js @supabase/ssr

Env: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY (both zod-validated in src/env.ts).

Three clients, three files

src/lib/supabase/client.ts — browser:

import { createBrowserClient } from '@supabase/ssr'

export function createClient() {
  return createBrowserClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!
  )
}

src/lib/supabase/server.ts — Server Components, Route Handlers, Actions:

import { createServerClient } from '@supabase/ssr'
import { cookies } from 'next/headers'

export async function createClient() {
  const cookieStore = await cookies()

  return createServerClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
    {
      cookies: {
        getAll() {
          return cookieStore.getAll()
        },
        setAll(cookiesToSet, _headers) {
          try {
            cookiesToSet.forEach(({ name, value, options }) =>
              cookieStore.set(name, value, options)
            )
          } catch {
            // Called from a Server Component — safe to ignore when the proxy
            // is refreshing sessions.
          }
        },
      },
    }
  )
}

src/lib/supabase/proxy.ts — the session refresher:

import { createServerClient } from '@supabase/ssr'
import { NextResponse, type NextRequest } from 'next/server'

export async function updateSession(request: NextRequest) {
  let supabaseResponse = NextResponse.next({ request })

  // With Fluid compute, never hoist this client into a module-level variable.
  const supabase = createServerClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
    {
      cookies: {
        getAll() {
          return request.cookies.getAll()
        },
        setAll(cookiesToSet, headers) {
          cookiesToSet.forEach(({ name, value }) => request.cookies.set(name, value))
          supabaseResponse = NextResponse.next({ request })
          cookiesToSet.forEach(({ name, value, options }) =>
            supabaseResponse.cookies.set(name, value, options)
          )
          Object.entries(headers).forEach(([key, value]) =>
            supabaseResponse.headers.set(key, value)
          )
        },
      },
    }
  )

  // Do not run code between createServerClient and getClaims().
  const { data } = await supabase.auth.getClaims()
  const user = data?.claims

  if (!user && !request.nextUrl.pathname.startsWith('/login')) {
    const url = request.nextUrl.clone()
    url.pathname = '/login'
    return NextResponse.redirect(url)
  }

  return supabaseResponse
}

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 162 lines · 82 tokens per session scan A 0a96c0c86f26

Subscribe to this mod's changes

supabase-auth is a skill published in the GitHub repository textura-agency/next16-claude-starter (117 stars, last pushed 4d ago), licensed Unlicense. It adds 82 tokens to every session and 1,320 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

nextjs-pages-router

Set up tRPC in Next.js Pages Router with createNextApiHandler, createTRPCNext, withTRPC HOC, SSR via ssr option and ssrPrepass, SSG via createServerSideHelpers with getStaticProps, and server-side helpers for getServerSideProps prefetching.

trpc/trpc · 67 tokens

with-tanstack-query

Compose Angular Query with signal-owned Table filtering, sorting, and pagination state using reactive query options, manual row-model boundaries, direct query data, server counts, and valid injection context.

TanStack/table · 42 tokens

auth-web-cloudbase

CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.

TencentCloudBase/CloudBase-AI-Toolkit · 38 tokens

service-digital-engagement-channel-configure

Configures and deploys enhanced chat Messaging Channels for Messaging for In-App and Web (MIAW). Use when the user needs to create, deploy, and activate a messaging channel configured with Omni-Channel Flow, Omni-Channel Queue, User, or Agentforce Service Agent routing. Generates MessagingChannel metadata, deploys it…

forcedotcom/sf-skills · 173 tokens

om-system-extension

Extend installed Open Mercato modules through UMES enrichers, interceptors, mutation guards, widgets, menus, entity extensions, events, component/page replacements, and overrides. Use for "extend core", "add field/column/action", "hide page", "intercept API", "UMES", or "rozszerz moduł".

open-mercato/open-mercato · 73 tokens

selenide-skill

Generates Selenide tests in Java. Concise UI testing framework built on Selenium with automatic waits and fluent API. Use when user mentions "Selenide", "$(selector)", "shouldBe(visible)", "Selenide Java". Triggers on: "Selenide", "$() selector", "shouldBe", "shouldHave", "Selenide test".

LambdaTest/agent-skills · 80 tokens