You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: explicit cors config shape ('default' | 'none' | { headers })
Keeps boolean/Record forms accepted but deprecated.
* refactor: rename cors 'none' to 'disabled'
Reads more clearly as an on/off switch and matches the SDK-1149 proposal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,22 +236,24 @@ interface SupabaseContext {
236
236
withSupabase(
237
237
{
238
238
auth: 'user', // who can call this function
239
-
cors: false, // disable CORS (default: supabase-js CORS headers)
239
+
cors: 'disabled', // disable CORS (default: supabase-js CORS headers)
240
240
env: { url: '...' }, // env overrides (optional)
241
241
},
242
242
handler,
243
243
)
244
244
```
245
245
246
-
`cors` defaults to the standard [supabase-js CORS headers](https://supabase.com/docs/guides/functions/cors). Pass a `Record<string, string>` to set custom headers, or `false` to disable CORS handling (e.g. when using a framework that handles CORS separately).
246
+
`cors` accepts `'default'` (the standard [supabase-js CORS headers](https://supabase.com/docs/guides/functions/cors), also the default), `'disabled'` to disable CORS handling (e.g. when using a framework that handles CORS separately), or `{ headers }` to set custom headers. The boolean (`true`/`false`) and bare `Record<string, string>` forms are deprecated but still accepted.
`cors` accepts `'default'` (standard supabase-js headers), `'disabled'`, or
143
+
`{ headers }`for custom headers. The boolean (`true`/`false`) and bare
144
+
`Record<string, string>` forms are deprecated but still accepted.
145
+
140
146
## Runtimes
141
147
142
148
`withSupabase` and `createSupabaseContext` work with any runtime that supports the Web API `Request`/`Response` standard. The [core primitives](core-primitives.md) go further — they work in any environment where you can extract headers, regardless of the request/response model (Express, Fastify, etc.).
0 commit comments