mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
docs: indicate publishable key instead of anon in many examples (#37411)
* docs: indicate publishable key instead of anon in many examples * replace your-anon-key to string indicating publishable or anon * fix your_... * apply suggestion from @ChrisChinchilla Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com> * Update keys in code examples * Prettier fix * Update apps/docs/content/guides/functions/schedule-functions.mdx --------- Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
This commit is contained in:
1 parent
be45baf6c4
commit
93ba2a312c
154 files changed
+612
-491
No files matched your search
@@ -24,7 +24,7 @@ export const supabaseMiddleware = (): MiddlewareHandler => {
|
||||
const supabaseEnv = env<SupabaseEnv>(c);
|
||||
const supabaseUrl =
|
||||
supabaseEnv.VITE_SUPABASE_URL ?? import.meta.env.VITE_SUPABASE_URL;
|
||||
const supabaseAnonKey =
|
||||
const supabasePublishableKey =
|
||||
supabaseEnv.VITE_SUPABASE_ANON_KEY ??
|
||||
import.meta.env.VITE_SUPABASE_ANON_KEY;
|
||||
|
||||
@@ -32,11 +32,11 @@ export const supabaseMiddleware = (): MiddlewareHandler => {
|
||||
throw new Error('SUPABASE_URL missing!');
|
||||
}
|
||||
|
||||
if (!supabaseAnonKey) {
|
||||
if (!supabasePublishableKey) {
|
||||
throw new Error('SUPABASE_ANON_KEY missing!');
|
||||
}
|
||||
|
||||
const supabase = createServerClient(supabaseUrl, supabaseAnonKey, {
|
||||
const supabase = createServerClient(supabaseUrl, supabasePublishableKey, {
|
||||
cookies: {
|
||||
getAll() {
|
||||
return parseCookieHeader(c.req.header('Cookie') ?? '');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Update these with your Supabase details from your project settings > API
|
||||
# https://app.supabase.com/project/_/settings/api
|
||||
NEXT_PUBLIC_SUPABASE_URL=your-project-url
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
|
||||
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-publishable-key
|
||||
@@ -67,10 +67,10 @@ If you wish to just develop locally and not deploy to Vercel, [follow the steps
|
||||
|
||||
```
|
||||
NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY=[INSERT SUPABASE PROJECT API ANON KEY]
|
||||
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=[INSERT SUPABASE PROJECT API ANON KEY]
|
||||
```
|
||||
|
||||
Both `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY` can be found in [your Supabase project's API settings](https://app.supabase.com/project/_/settings/api)
|
||||
Both `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` can be found in [your Supabase project's API settings](https://app.supabase.com/project/_/settings/api)
|
||||
|
||||
5. You can now run the Next.js local development server:
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ import { createBrowserClient } from "@supabase/ssr"
|
||||
export function createClient() {
|
||||
return createBrowserClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
||||
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!
|
||||
)
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export async function updateSession(request: NextRequest) {
|
||||
|
||||
const supabase = createServerClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
|
||||
{
|
||||
cookies: {
|
||||
getAll() {
|
||||
|
||||
@@ -6,7 +6,7 @@ export async function createClient() {
|
||||
|
||||
return createServerClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
|
||||
{
|
||||
cookies: {
|
||||
getAll() {
|
||||
|
||||
Reference in new issue
Block a user