Skip to content

Commit 35ceae2

Browse files
authored
docs: add titles to examples (#98)
1 parent 2f5dbc6 commit 35ceae2

14 files changed

Lines changed: 28 additions & 37 deletions

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
## [1.3.1](https://github.com/supabase/server/compare/server-v1.3.0...server-v1.3.1) (2026-07-03)
44

5-
65
### Bug Fixes
76

8-
* expand [@module](https://github.com/module) comment to restore rich JSR overview ([#96](https://github.com/supabase/server/issues/96)) ([a41aeeb](https://github.com/supabase/server/commit/a41aeebd59ef99ca04bd8bbed859ab046b5de61d))
7+
- expand [@module](https://github.com/module) comment to restore rich JSR overview ([#96](https://github.com/supabase/server/issues/96)) ([a41aeeb](https://github.com/supabase/server/commit/a41aeebd59ef99ca04bd8bbed859ab046b5de61d))
98

109
## [1.3.0](https://github.com/supabase/server/compare/server-v1.2.0...server-v1.3.0) (2026-07-03)
1110

jsr.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@
1111
"./adapters/nestjs": "./src/adapters/nestjs/index.ts"
1212
},
1313
"publish": {
14-
"include": [
15-
"src/**/*.ts",
16-
"README.md",
17-
"LICENSE"
18-
],
19-
"exclude": [
20-
"src/**/*.test.ts",
21-
"src/**/*.spec.ts"
22-
]
14+
"include": ["src/**/*.ts", "README.md", "LICENSE"],
15+
"exclude": ["src/**/*.test.ts", "src/**/*.spec.ts"]
2316
}
2417
}

src/adapters/hono/middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { MiddlewareHandler } from 'hono'
2-
import { HTTPException } from 'hono/http-exception'
32
import { createMiddleware } from 'hono/factory'
3+
import { HTTPException } from 'hono/http-exception'
44

55
import { createSupabaseContext } from '../../create-supabase-context.js'
66
import type { SupabaseContext, WithSupabaseConfig } from '../../types.js'
@@ -14,7 +14,7 @@ import type { SupabaseContext, WithSupabaseConfig } from '../../types.js'
1414
* @param config - Auth modes and optional environment overrides. CORS is excluded — use Hono's `cors()`.
1515
* @returns A Hono middleware that sets `c.var.supabaseContext`.
1616
*
17-
* @example
17+
* @example App-wide auth via app.use()
1818
* ```ts
1919
* import { Hono } from 'hono'
2020
* import { withSupabase } from '@supabase/server/adapters/hono'

src/adapters/nestjs/decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { SupabaseContext } from '../../types.js'
1212
* by `withSupabase()`. Pass a key (e.g. `'supabase'`, `'userClaims'`) to pull
1313
* a single field, or no argument to receive the whole context.
1414
*
15-
* @example
15+
* @example Injecting the context into a route handler
1616
* ```ts
1717
* import { Controller, Get, UseGuards } from '@nestjs/common'
1818
* import { withSupabase, SupabaseCtx } from '@supabase/server/adapters/nestjs'

src/core/create-admin-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { resolveEnv } from './resolve-env.js'
1616
*
1717
* @throws {@link index.EnvError} If `SUPABASE_URL` is missing or the specified secret key is not found.
1818
*
19-
* @example
19+
* @example Basic usage
2020
* ```ts
2121
* const supabaseAdmin = createAdminClient()
2222
* const { data } = await supabaseAdmin.from('audit_log').insert({ action: 'user_login' })

src/core/create-context-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { resolveEnv } from './resolve-env.js'
1616
*
1717
* @throws {@link index.EnvError} If `SUPABASE_URL` is missing or the specified publishable key is not found.
1818
*
19-
* @example
19+
* @example With verified auth
2020
* ```ts
2121
* const { data: auth } = await verifyAuth(request, { auth: 'user' })
2222
* const supabase = createContextClient({

src/core/extract-credentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { Credentials } from '../types.js'
1313
* @param request - The incoming HTTP request.
1414
* @returns The extracted {@link Credentials}. Fields are `null` when the corresponding header is absent.
1515
*
16-
* @example
16+
* @example Basic usage
1717
* ```ts
1818
* import { extractCredentials } from '@supabase/server/core'
1919
*

src/core/resolve-env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { EnvError, Errors, MissingSupabaseURLError } from '../errors.js'
21
import type { JSONWebKeySet } from 'jose'
32

3+
import { EnvError, Errors, MissingSupabaseURLError } from '../errors.js'
44
import type { SupabaseEnv } from '../types.js'
55

66
/**
@@ -149,7 +149,7 @@ function resolveJwks(): JSONWebKeySet | URL | null {
149149
* @param overrides - Partial values that take precedence over env vars.
150150
* @returns `{ data: SupabaseEnv, error: null }` on success, `{ data: null, error: EnvError }` on failure.
151151
*
152-
* @example
152+
* @example Reading and overriding env vars
153153
* ```ts
154154
* const { data: env, error } = resolveEnv()
155155
* if (error) throw error

src/core/verify-auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface VerifyAuthOptions {
4242
* - On success: `{ data: AuthResult, error: null }`
4343
* - On failure: `{ data: null, error: AuthError }`
4444
*
45-
* @example
45+
* @example User auth
4646
* ```ts
4747
* import { verifyAuth } from '@supabase/server/core'
4848
*

src/core/verify-credentials.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import type {
1919
SupabaseEnv,
2020
UserClaims,
2121
} from '../types.js'
22+
import { resolveEnv } from './resolve-env.js'
2223
import { resolveAuthOption } from './utils/deprecation.js'
2324
import { timingSafeEqual } from './utils/timing-safe-equal.js'
24-
import { resolveEnv } from './resolve-env.js'
2525

2626
/**
2727
* Options for {@link verifyCredentials}.
@@ -295,7 +295,7 @@ async function tryMode(
295295
* @param options - Allowed auth modes and optional env overrides.
296296
* @returns `{ data: AuthResult, error: null }` on success, `{ data: null, error: AuthError }` on failure.
297297
*
298-
* @example
298+
* @example Multiple auth modes
299299
* ```ts
300300
* const credentials = extractCredentials(request)
301301
* const { data: auth, error } = await verifyCredentials(credentials, {

0 commit comments

Comments
 (0)