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
Alternatively, you can prefix the env variables with `NUXT_PUBLIC_` in order to use runtimeConfig.
38
+
The legacy `SUPABASE_URL` and `SUPABASE_KEY` env variables are still supported as fallbacks. Using the `NUXT_` prefix is recommended as it follows Nuxt's [runtimeConfig](https://nuxt.com/docs/guide/going-further/runtime-config) convention and allows overriding values at runtime without rebuilding.
Default: `NUXT_PUBLIC_SUPABASE_URL`env variable (falls back to `SUPABASE_URL`) (ex: <https://example.supabase.co>)
57
57
58
58
The unique Supabase URL which is supplied when you create a new project in your project dashboard.
59
59
60
60
### `key`
61
61
62
-
Default: `process.env.SUPABASE_KEY`
62
+
Default: `NUXT_PUBLIC_SUPABASE_KEY`env variable (falls back to `SUPABASE_KEY`)
63
63
64
64
Supabase `publishablekey`, used to verify and decode the JWT. Can bypass the Supabase API gateway and interact with your Supabase database applying RLS Policies.
65
65
@@ -69,17 +69,17 @@ In `v1.x.x` and earlier, this was referring to the `anon key`. With the introduc
69
69
70
70
### `secretKey`
71
71
72
-
Default: `process.env.SUPABASE_SECRET_KEY`
72
+
Default: `NUXT_SUPABASE_SECRET_KEY`env variable (falls back to `SUPABASE_SECRET_KEY`)
73
73
74
74
Supabase `secretkey`, has super admin rights and can bypass your Row Level Security.
75
75
76
76
::warning
77
-
This key should be kept secret and never exposed to the client. Keep it in environment variables.
77
+
This key is server-only and never exposed to the client. Keep it in environment variables.
Copy file name to clipboardExpand all lines: docs/content/1.getting-started/4.migration.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,10 @@ Before migrating your environment variables, you need to enable JWT signing keys
133
133
#### 2.b. Use your new keys in your `.env` file
134
134
135
135
```bash [.env]
136
-
SUPABASE_KEY=<your_publishable_key>
137
-
SUPABASE_SECRET_KEY=<your_secret_key>
136
+
NUXT_PUBLIC_SUPABASE_KEY=<your_publishable_key>
137
+
NUXT_SUPABASE_SECRET_KEY=<your_secret_key>
138
138
```
139
+
140
+
::tip
141
+
The legacy `SUPABASE_KEY` and `SUPABASE_SECRET_KEY` env variables are still supported as fallbacks. See the [introduction](/getting-started/introduction) for details.
Copy file name to clipboardExpand all lines: docs/content/2.composables/useSupabaseClient.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: Make requests to the Supabase API with the useSupabaseClient compos
7
7
8
8
This composable is using [supabase-js](https://github.com/supabase/supabase-js/) under the hood, it gives access to the [Supabase client](https://supabase.com/docs/reference/javascript/initializing).
9
9
10
-
> The client is initialized with the `SUPABASE_KEY` you must have in your `.env` file. It establishes the connection with the database and make use of user JWT to apply [RLS Policies](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) implemented in Supabase. If you want to bypass policies, you can use the [serverSupabaseServiceRole](/services/serversupabaseservicerole).
10
+
> The client is initialized with the `NUXT_PUBLIC_SUPABASE_KEY` you must have in your `.env` file. It establishes the connection with the database and make use of user JWT to apply [RLS Policies](https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security) implemented in Supabase. If you want to bypass policies, you can use the [serverSupabaseServiceRole](/services/serversupabaseservicerole).
Copy file name to clipboardExpand all lines: docs/content/3.services/2.serverSupabaseServiceRole.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This function is designed to work only in [server routes](https://nuxt.com/docs/
14
14
15
15
It works similary as the [serverSupabaseClient](/services/serversupabaseclient) but it provides a client with super admin rights that can bypass your [Row Level Security](https://supabase.com/docs/guides/auth/row-level-security).
16
16
17
-
> The client is initialized with the `SUPABASE_SECRET_KEY` (recommended) or `SUPABASE_SERVICE_KEY` (deprecated) you must have in your `.env` file. We recommend using the new JWT signing keys (`SUPABASE_SECRET_KEY`) as described in the [Supabase blog post](https://supabase.com/blog/jwt-signing-keys).
17
+
> The client is initialized with the `NUXT_SUPABASE_SECRET_KEY`you must have in your `.env` file. See the [Supabase blog post](https://supabase.com/blog/jwt-signing-keys) for more on JWT signing keys.
18
18
19
19
Define your server route and just import the `serverSupabaseServiceRole` from `#supabase/server`.
logger.warn('`SUPABASE_SERVICE_KEY` is deprecated and will be removed in a future version. Please migrate to `SUPABASE_SECRET_KEY` (JWT signing key). See: https://supabase.com/blog/jwt-signing-keys')
237
+
logger.warn('`SUPABASE_SERVICE_KEY` is deprecated. Migrate to `NUXT_SUPABASE_SECRET_KEY`. See: https://supabase.com/blog/jwt-signing-keys')
thrownewError('Missing server key. Set either `SUPABASE_SECRET_KEY` (recommended) or `SUPABASE_SERVICE_KEY` (deprecated) in your environment variables.')
20
+
thrownewError('Missing server key. Set `NUXT_SUPABASE_SECRET_KEY` in your environment variables.')
21
21
}
22
22
23
23
// No need to recreate client if exists in request context
0 commit comments