@supabase/lite 0.9.0 → 0.9.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FEATURES.md +176 -0
- package/LIMITATIONS.md +1 -0
- package/README.md +1 -0
- package/STATUS.md +7 -1
- package/dist/cli/index.js +86 -86
- package/dist/db/postgres/pglite/PgliteConnection.js +17 -17
- package/dist/index.d.ts +26 -2
- package/dist/index.js +55 -55
- package/dist/vite/index.d.ts +26 -2
- package/docs/auth/email.mdx +214 -0
- package/docs/auth/not-supported.mdx +57 -0
- package/docs/auth/overview.mdx +52 -0
- package/docs/auth/supported-flows.mdx +120 -0
- package/docs/cli/overview.mdx +112 -0
- package/docs/cli/telemetry.mdx +34 -0
- package/docs/compatibility.mdx +115 -0
- package/docs/database/backends.mdx +118 -0
- package/docs/database/data-api.mdx +90 -0
- package/docs/database/functions-triggers.mdx +93 -0
- package/docs/database/migrations.mdx +93 -0
- package/docs/database/overview.mdx +66 -0
- package/docs/database/postgres-sqlite-translation.mdx +130 -0
- package/docs/database/rls.mdx +159 -0
- package/docs/database/schemas.mdx +58 -0
- package/docs/index.mdx +49 -0
- package/docs/integrations/embedded.mdx +83 -0
- package/docs/integrations/frameworks.mdx +83 -0
- package/docs/integrations/vite.mdx +85 -0
- package/docs/llms.txt +52 -0
- package/docs/other/edge-functions.mdx +34 -0
- package/docs/other/realtime.mdx +22 -0
- package/docs/quickstart.mdx +150 -0
- package/docs/running.mdx +117 -0
- package/docs/storage/adapters.mdx +75 -0
- package/docs/storage/limitations.mdx +30 -0
- package/docs/storage/overview.mdx +82 -0
- package/docs/upgrade.mdx +108 -0
- package/package.json +4 -1
- package/skills/supalite/SKILL.md +5 -3
package/dist/vite/index.d.ts
CHANGED
|
@@ -2168,7 +2168,18 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
|
|
|
2168
2168
|
status: hono_utils_http_status.StatusCode;
|
|
2169
2169
|
};
|
|
2170
2170
|
};
|
|
2171
|
-
}, "/rest/v1"> | hono_types.MergeSchemaPath<hono_types.BlankSchema | hono_types.MergeSchemaPath<{
|
|
2171
|
+
}, "/rest/v1"> | hono_types.MergeSchemaPath<(hono_types.BlankSchema | hono_types.MergeSchemaPath<{
|
|
2172
|
+
"/status": {
|
|
2173
|
+
$get: {
|
|
2174
|
+
input: {};
|
|
2175
|
+
output: {
|
|
2176
|
+
status: string;
|
|
2177
|
+
};
|
|
2178
|
+
outputFormat: "json";
|
|
2179
|
+
status: 200;
|
|
2180
|
+
};
|
|
2181
|
+
};
|
|
2182
|
+
} & {
|
|
2172
2183
|
"/object/public/:bucketId/*": {
|
|
2173
2184
|
$get: {
|
|
2174
2185
|
input: {
|
|
@@ -2626,7 +2637,20 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
|
|
|
2626
2637
|
status: 404;
|
|
2627
2638
|
};
|
|
2628
2639
|
};
|
|
2629
|
-
}, "/"
|
|
2640
|
+
}, "/">) & {
|
|
2641
|
+
"*": {
|
|
2642
|
+
$all: {
|
|
2643
|
+
input: {};
|
|
2644
|
+
output: {
|
|
2645
|
+
message: string;
|
|
2646
|
+
error: string;
|
|
2647
|
+
statusCode: number;
|
|
2648
|
+
};
|
|
2649
|
+
outputFormat: "json";
|
|
2650
|
+
status: 404;
|
|
2651
|
+
};
|
|
2652
|
+
};
|
|
2653
|
+
}, "/storage/v1"> | hono_types.MergeSchemaPath<{
|
|
2630
2654
|
"/ping": {
|
|
2631
2655
|
$get: {
|
|
2632
2656
|
input: {};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Email delivery & templates"
|
|
3
|
+
description: "Configure the email driver, verification links, and customizable transactional email templates for Supabase Lite Auth."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
Supabase Lite sends the same transactional emails as Supabase (signup confirmation, magic link, password recovery, email change, reauthentication). Out of the box it ships Supabase-styled HTML templates and builds verification links from your `site_url`, so email auth works with zero configuration. Everything is overridable. By default, emails are printed to the server console and nothing is actually delivered until you configure a real driver.
|
|
9
|
+
|
|
10
|
+
## Local development: the console mail catcher
|
|
11
|
+
|
|
12
|
+
The default driver, `ConsoleEmailDriver`, requires no configuration: it logs every outgoing email to the server console instead of sending it, so you can develop and test email flows without a mail provider. Each email is printed as `To`, `Subject`, and the rendered plain-text body (the default templates put the OTP code and the confirmation link in that body). HTML is never printed.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
[@supabase/lite] email captured (not delivered)
|
|
16
|
+
To: user@example.test
|
|
17
|
+
Subject: Confirm Your Signup
|
|
18
|
+
|
|
19
|
+
Confirm your signup with this code: 123456
|
|
20
|
+
|
|
21
|
+
Or follow this link: http://localhost:3000/auth/v1/verify?token=...&type=signup&redirect_to=http%3A%2F%2Flocalhost%3A3000
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Grep the server output for `email captured` to find these entries among your other logs.
|
|
25
|
+
|
|
26
|
+
This is Supabase Lite's equivalent of the Supabase CLI's Mailpit: the CLI runs a local SMTP server and web UI at `localhost:54324` (config section `[inbucket]`) that catches every email your project sends. Lite has no built-in SMTP server or mailbox UI; it prints to the console by default. Point `[auth.email.smtp]` at a real SMTP server (including a local one like Mailpit) to send for real — see [SMTP](#smtp) below. `[inbucket]` is still parsed for compatibility but not acted on: lite never starts a local mailbox service.
|
|
27
|
+
|
|
28
|
+
Note that `enable_confirmations` under `[auth.email]` defaults to `false`, matching upstream, so signups autoconfirm and no email is sent at all until you turn it on.
|
|
29
|
+
|
|
30
|
+
To silence the console output, pass `{ silent: true }`; to send it somewhere else (a file, a test spy, structured logging), pass a custom `logger`:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { App, ConsoleEmailDriver } from "@supabase/lite";
|
|
34
|
+
|
|
35
|
+
const app = new App({
|
|
36
|
+
connection,
|
|
37
|
+
auth: { jwt_secret, site_url: "https://app.example.com" },
|
|
38
|
+
options: {
|
|
39
|
+
drivers: {
|
|
40
|
+
email: new ConsoleEmailDriver({ silent: true }),
|
|
41
|
+
// or: new ConsoleEmailDriver({ logger: { info: (message) => myLogger.info(message) } }),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Verification links
|
|
48
|
+
|
|
49
|
+
Emailed links point at the auth server's verify endpoint:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
{site_url}/auth/v1/verify?token=<hash>&type=<type>&redirect_to=<redirect_to>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`GET /auth/v1/verify` verifies the token server-side and issues a `303` redirect to `redirect_to` (falling back to `site_url` if the target is not allow-listed), with the session in the URL fragment on success or `error`/`error_code` on failure — matching GoTrue. Set `site_url` (and any `additional_redirect_urls`) under `[auth]`:
|
|
56
|
+
|
|
57
|
+
```toml
|
|
58
|
+
[auth]
|
|
59
|
+
site_url = "https://app.example.com"
|
|
60
|
+
additional_redirect_urls = ["https://app.example.com/welcome"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The 6-digit numeric code is delivered in the same email and verified against the database, so both `verifyOtp({ token_hash })` and `verifyOtp({ email, token })` work with any driver and across isolates.
|
|
64
|
+
|
|
65
|
+
## SMTP
|
|
66
|
+
|
|
67
|
+
Unlike the other drivers, SMTP can be configured directly in `config.toml` — matching `supabase start`, which wires `GOTRUE_SMTP_*` from the same section. Set `enabled = true` and lite auto-selects `SmtpEmailDriver`, no `options.drivers.email` needed:
|
|
68
|
+
|
|
69
|
+
```toml
|
|
70
|
+
[auth.email.smtp]
|
|
71
|
+
enabled = true
|
|
72
|
+
host = "localhost"
|
|
73
|
+
port = 1025
|
|
74
|
+
user = "apikey"
|
|
75
|
+
pass = "env(SMTP_PASSWORD)"
|
|
76
|
+
admin_email = "admin@example.com"
|
|
77
|
+
sender_name = "My App"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`host`, `port`, `user`, `pass`, and `admin_email` are all required when `enabled = true` — matching the upstream `supabase` CLI's own validation. The app throws a clear config error at startup otherwise: `Missing required field in config: auth.email.smtp.<field>`. That example points at [Mailpit](https://mailpit.axllent.org/) running locally (`docker run -p 1025:1025 -p 8025:8025 axllent/mailpit`); open `http://localhost:8025` for the mailbox UI (Mailpit accepts any user/pass).
|
|
81
|
+
|
|
82
|
+
`SmtpEmailDriver` is also available for programmatic construction, same as the other bundled drivers:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
import { App, SmtpEmailDriver } from "@supabase/lite";
|
|
86
|
+
|
|
87
|
+
const app = new App({
|
|
88
|
+
connection,
|
|
89
|
+
auth: { jwt_secret, site_url: "https://app.example.com" },
|
|
90
|
+
options: {
|
|
91
|
+
drivers: {
|
|
92
|
+
email: new SmtpEmailDriver({
|
|
93
|
+
host: "smtp.sendgrid.net",
|
|
94
|
+
port: 587,
|
|
95
|
+
user: "apikey",
|
|
96
|
+
pass: process.env.SENDGRID_API_KEY!,
|
|
97
|
+
from: "auth@example.com",
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`SmtpEmailDriver` sends via [Nodemailer](https://nodemailer.com/). TLS behavior follows Nodemailer's own options: implicit TLS on port `465` (`secure` defaults to `port === 465`), opportunistic `STARTTLS` otherwise. When credentials (`user`/`pass`) are configured and the connection isn't already implicit-TLS, `requireTls` defaults to `true` — the driver fails instead of sending credentials over a plaintext connection when `STARTTLS` isn't offered. Pass `requireTls: false` to opt back into best-effort `STARTTLS`, or `rejectUnauthorized: false` to accept a self-signed certificate. Config-driven SMTP (`[auth.email.smtp]`) always has credentials (they're required), so it always requires TLS by default.
|
|
105
|
+
|
|
106
|
+
`from` (and the programmatic driver's `from` option) accepts either a plain address string or a structured `{ name, address }` object; Nodemailer encodes the display name safely, so names containing quotes or non-ASCII characters round-trip correctly in the generated MIME. `sender_name` in `config.toml` is passed through this way automatically.
|
|
107
|
+
|
|
108
|
+
`SmtpEmailDriver` requires Node or Bun (Nodemailer needs `node:net`/`node:tls`). It is not supported on Cloudflare Workers or in the browser — `send()` throws `SMTP email is not supported in this runtime (SmtpEmailDriver requires Node or Bun)` there.
|
|
109
|
+
|
|
110
|
+
<Aside type="caution">
|
|
111
|
+
Explicit `options.drivers.email` always wins over `[auth.email.smtp]`, even when `enabled = true`. `enabled` is a plain boolean and defaults to its zero value, `false`: an `[auth.email.smtp]` section present in `config.toml` without `enabled = true` (or with it explicitly `false`) behaves exactly like no section at all — `ConsoleEmailDriver` is used.
|
|
112
|
+
</Aside>
|
|
113
|
+
|
|
114
|
+
## Choosing an email driver
|
|
115
|
+
|
|
116
|
+
The default driver is `ConsoleEmailDriver` (see [Local development](#local-development-the-console-mail-catcher) above), which only logs emails to the console. Real drivers (`Resend`, `AWS SES`, `Sendmail`, `SMTP`) ship with the library and are injected programmatically when you construct the app:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import { App, ResendEmailDriver } from "@supabase/lite";
|
|
120
|
+
|
|
121
|
+
const app = new App({
|
|
122
|
+
connection,
|
|
123
|
+
auth: {
|
|
124
|
+
jwt_secret,
|
|
125
|
+
site_url: "https://app.example.com",
|
|
126
|
+
email: { enable_confirmations: true },
|
|
127
|
+
},
|
|
128
|
+
options: {
|
|
129
|
+
drivers: {
|
|
130
|
+
email: new ResendEmailDriver({
|
|
131
|
+
apiKey: process.env.RESEND_API_KEY!,
|
|
132
|
+
from: "auth@example.com",
|
|
133
|
+
}),
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`AwsSesEmailDriver`, `SendmailEmailDriver`, and `SmtpEmailDriver` (see [SMTP](#smtp) above) are available from the same entry point. Any object implementing `send({ to, subject, text, html })` works as a custom driver.
|
|
140
|
+
|
|
141
|
+
## Bring your own provider
|
|
142
|
+
|
|
143
|
+
If none of the bundled drivers fit, implement `EmailDriver` yourself. It needs one method, `send({ to, subject, text, html })`:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import type { EmailDriver } from "@supabase/lite";
|
|
147
|
+
|
|
148
|
+
class MyApiEmailDriver implements EmailDriver {
|
|
149
|
+
async send({ to, subject, text, html }: {
|
|
150
|
+
to: string; subject: string; text?: string; html?: string;
|
|
151
|
+
}) {
|
|
152
|
+
await fetch("https://api.my-email-provider.test/v1/send", {
|
|
153
|
+
method: "POST",
|
|
154
|
+
headers: {
|
|
155
|
+
Authorization: `Bearer ${process.env.MY_EMAIL_API_KEY}`,
|
|
156
|
+
"Content-Type": "application/json",
|
|
157
|
+
},
|
|
158
|
+
body: JSON.stringify({ to, subject, text, html }),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Custom drivers are always injected via `options.drivers.email` when constructing the `App`, the same as the bundled drivers above. SMTP is the one exception: it also auto-selects from `[auth.email.smtp]` in `config.toml` (see [SMTP](#smtp)), though an explicit `options.drivers.email` still wins over it.
|
|
165
|
+
|
|
166
|
+
## OTP length and expiry
|
|
167
|
+
|
|
168
|
+
```toml
|
|
169
|
+
[auth.email]
|
|
170
|
+
otp_length = 6 # digits in the emailed code
|
|
171
|
+
otp_expiry = 3600 # seconds before the code / link expires (default 1 hour)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Expiry is enforced in `verifyOtp` against the token's `*_sent_at` timestamp; an expired code returns `otp_expired`.
|
|
175
|
+
|
|
176
|
+
## Secure email change
|
|
177
|
+
|
|
178
|
+
When a user changes their email, `double_confirm_changes` (default `true`) controls how the change is confirmed:
|
|
179
|
+
|
|
180
|
+
- **`true` (secure):** the confirmation that finalizes the change is delivered to the **current** address and hashed with it. Confirming it changes the account email. A token delivered to the pending new address cannot finalize the change on its own.
|
|
181
|
+
- **`false` (insecure):** the confirmation is sent to the new address and confirming it finalizes the change immediately.
|
|
182
|
+
|
|
183
|
+
<Aside type="caution">
|
|
184
|
+
Supabase Lite's secure email change is **partial**: it confirms from the current mailbox before finalizing (so a stolen session cannot move the account email to an attacker's mailbox using only that mailbox), but it does **not** implement GoTrue's full two-mailbox flow that requires *both* the old and new addresses to confirm before the change takes effect. The current-email confirmation alone finalizes. See [LIMITATIONS.md](https://github.com/supabase-community/lite/blob/main/LIMITATIONS.md).
|
|
185
|
+
</Aside>
|
|
186
|
+
|
|
187
|
+
## Customizing templates
|
|
188
|
+
|
|
189
|
+
Override the subject and HTML per email type under `[auth.email.template.<type>]`, where `<type>` is one of `invite`, `confirmation`, `recovery`, `magic_link`, `email_change`:
|
|
190
|
+
|
|
191
|
+
```toml
|
|
192
|
+
[auth.email.template.confirmation]
|
|
193
|
+
subject = "Confirm your account"
|
|
194
|
+
content_path = "./emails/confirmation.html"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Templates use the same Go-template variables as upstream GoTrue, so existing Supabase templates work unchanged:
|
|
198
|
+
|
|
199
|
+
| Variable | Description |
|
|
200
|
+
|---|---|
|
|
201
|
+
| `{{ .ConfirmationURL }}` | Full verification link (see above) |
|
|
202
|
+
| `{{ .Token }}` | The numeric OTP code |
|
|
203
|
+
| `{{ .TokenHash }}` | The hashed token used in the link |
|
|
204
|
+
| `{{ .SiteURL }}` | Configured `site_url` |
|
|
205
|
+
| `{{ .Email }}` | Recipient email |
|
|
206
|
+
| `{{ .NewEmail }}` | New address (email change) |
|
|
207
|
+
| `{{ .RedirectTo }}` | Post-verification redirect target |
|
|
208
|
+
| `{{ .Data }}` | User metadata |
|
|
209
|
+
|
|
210
|
+
<Aside type="caution">
|
|
211
|
+
`content_path` is read from the filesystem, so it is available on Node and the CLI but not in browser or Cloudflare Workers bundles. On those runtimes the built-in default templates are used (or inline your HTML another way). Zero-config defaults work everywhere.
|
|
212
|
+
</Aside>
|
|
213
|
+
|
|
214
|
+
When no `content_path` is set, the built-in Supabase-styled default template for that type is used.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Auth: not supported"
|
|
3
|
+
description: "Anonymous sign-in, manual identity linking, the admin API, MFA, and OAuth providers beyond github/google are not implemented yet. What's planned vs. not planned, and the hosted-Supabase workaround."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
These gaps are backend-independent: they're missing regardless of whether you run SQLite, PGlite, or Postgres. Auth doesn't have the SQLite-vs-Postgres split the Data API has. Nothing here is a SQLite platform limitation; it's just not built yet.
|
|
9
|
+
|
|
10
|
+
<Aside type="caution">
|
|
11
|
+
If your app needs any of the flows below today, run it against hosted Supabase instead of Supabase Lite, or gate the feature until it lands.
|
|
12
|
+
</Aside>
|
|
13
|
+
|
|
14
|
+
<Aside type="note">
|
|
15
|
+
`signInWithOAuth()` / `exchangeCodeForSession()` are implemented for the `github` and `google` providers (PKCE + implicit flows, automatic account linking on a verified-email match). See [Supported flows](/auth/supported-flows). Enabling any other configured provider, including `apple`, returns "provider ... is not yet implemented" — that gap is tracked below.
|
|
16
|
+
</Aside>
|
|
17
|
+
|
|
18
|
+
## Planned
|
|
19
|
+
|
|
20
|
+
Config schema or partial groundwork exists; these are the next Auth surfaces on the roadmap.
|
|
21
|
+
|
|
22
|
+
| Method | Upstream doc | Notes |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `signInWithOAuth()` / `exchangeCodeForSession()` for other providers | [Social login](https://supabase.com/docs/guides/auth/social-login) | Config schema exists for the remaining 16 providers (incl. Apple); `github`/`google` already work |
|
|
25
|
+
| `signInAnonymously()` | [Anonymous sign-ins](https://supabase.com/docs/guides/auth/auth-anonymous) | Create an anonymous session |
|
|
26
|
+
| `linkIdentity()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Manually link an OAuth identity to an existing user; automatic linking on OAuth sign-in already works |
|
|
27
|
+
| `unlinkIdentity()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Remove a linked identity |
|
|
28
|
+
| `admin.createUser()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Direct user creation, skips confirmation |
|
|
29
|
+
| `admin.listUsers()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Paginated user list |
|
|
30
|
+
| `admin.getUserById()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Fetch user by ID |
|
|
31
|
+
| `admin.updateUserById()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Direct user update |
|
|
32
|
+
| `admin.deleteUser()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | User deletion |
|
|
33
|
+
| `admin.inviteUserByEmail()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Send an invite |
|
|
34
|
+
| `admin.generateLink()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Generate verification/reset links |
|
|
35
|
+
| `admin.signOut()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) | Admin-initiated logout |
|
|
36
|
+
| `admin.mfa.listFactors()` | [Auth MFA](https://supabase.com/docs/guides/auth/auth-mfa) | List a user's MFA factors |
|
|
37
|
+
| `admin.mfa.deleteFactor()` | [Auth MFA](https://supabase.com/docs/guides/auth/auth-mfa) | Remove an MFA factor |
|
|
38
|
+
|
|
39
|
+
## Not currently planned
|
|
40
|
+
|
|
41
|
+
No implementation work scheduled. Reach for hosted Supabase if you need these.
|
|
42
|
+
|
|
43
|
+
| Area | Methods | Upstream doc |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| MFA / TOTP | `mfa.enroll()`, `mfa.challenge()`, `mfa.verify()`, `mfa.challengeAndVerify()`, `mfa.unenroll()`, `mfa.listFactors()`, `mfa.getAuthenticatorAssuranceLevel()` | [Auth MFA](https://supabase.com/docs/guides/auth/auth-mfa) |
|
|
46
|
+
| WebAuthn | `mfa.webauthn.*` (5 methods) | [Auth MFA](https://supabase.com/docs/guides/auth/auth-mfa) |
|
|
47
|
+
| SSO/SAML | `signInWithSSO()` | [Auth guide](https://supabase.com/docs/guides/auth) |
|
|
48
|
+
| Web3 | `signInWithWeb3()` | [Auth guide](https://supabase.com/docs/guides/auth) |
|
|
49
|
+
| OIDC | `signInWithIdToken()` | [Auth guide](https://supabase.com/docs/guides/auth) |
|
|
50
|
+
| OAuth server | `oauth.getAuthorizationDetails()`, `oauth.approveAuthorization()`, `oauth.denyAuthorization()`, `oauth.listGrants()`, `oauth.revokeGrant()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) |
|
|
51
|
+
| OAuth admin | `oauth.listClients()`, `oauth.createClient()`, `oauth.getClient()`, `oauth.updateClient()`, `oauth.deleteClient()`, `oauth.regenerateClientSecret()` | [Auth admin API](https://supabase.com/docs/reference/javascript/auth-admin-api) |
|
|
52
|
+
|
|
53
|
+
## Related schema gaps
|
|
54
|
+
|
|
55
|
+
Because the OAuth 2.1 authorization server/admin surface and MFA aren't implemented, the underlying `auth.*` tables for those features (`auth.mfa_factors`, `auth.sso_providers`, `auth.oauth_clients`, and similar) also aren't reconciled against upstream. `auth.flow_state`, used by the implemented social-login PKCE flow, is reconciled.
|
|
56
|
+
|
|
57
|
+
For what does work today, see [Supported flows](/auth/supported-flows). For the general Auth model these gaps sit on top of, see the [Supabase Auth docs](https://supabase.com/docs/guides/auth).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Auth overview"
|
|
3
|
+
description: "GoTrue-compatible Auth API for @supabase/lite: what's implemented, what's planned, and how it fits into supabase-js."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside, Card, CardGrid } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
Supabase Lite ships a GoTrue-compatible Auth API at `/auth/v1/*`. For the methods it implements, `@supabase/supabase-js`'s `auth` client works unchanged: same request shapes, same JWT format, same session/refresh-token behavior.
|
|
9
|
+
|
|
10
|
+
<Aside type="note">
|
|
11
|
+
Auth support is capability-independent of the database backend. The same 13 endpoints work identically on SQLite, PGlite, and Postgres, since Auth is not a Postgres-vs-SQLite translation problem the way the Data API is. One exception: on the Cloudflare D1 backend, multi-statement Auth transaction spans (OAuth callback/token writes, email-change and other OTP verification) run best-effort without a wrapping transaction (D1 has no callback transaction API); single-statement guards still prevent auth-code/state reuse. All other backends, including Durable Objects, are fully transactional.
|
|
12
|
+
</Aside>
|
|
13
|
+
|
|
14
|
+
## Coverage
|
|
15
|
+
|
|
16
|
+
13 of 63 `supabase-js` auth methods are implemented as real backend endpoints, including OAuth sign-in for `github` and `google` (PKCE + implicit flows, automatic account linking). Of the remaining 50: 13 are planned (other OAuth providers incl. Apple, anonymous sign-in, manual identity linking, the admin API), 27 are not currently planned (MFA, SSO, Web3, OAuth-server), and 10 are client-side-only helpers that need no backend (`getSession`, `onAuthStateChange`, and similar) and already work as-is since they don't hit the network.
|
|
17
|
+
|
|
18
|
+
<CardGrid>
|
|
19
|
+
<Card title="Supported flows">
|
|
20
|
+
Email/password, OTP, sessions, password recovery, OAuth sign-in (github/google): the 13 implemented endpoints with examples. [Read more →](/auth/supported-flows/)
|
|
21
|
+
</Card>
|
|
22
|
+
<Card title="Not supported">
|
|
23
|
+
Other OAuth providers, anonymous sign-in, admin API, MFA: what's missing and the hosted-Supabase workaround. [Read more →](/auth/not-supported/)
|
|
24
|
+
</Card>
|
|
25
|
+
<Card title="Email delivery & templates">
|
|
26
|
+
The console mail catcher, choosing a real email driver, verification links, and customizable templates. [Read more →](/auth/email/)
|
|
27
|
+
</Card>
|
|
28
|
+
</CardGrid>
|
|
29
|
+
|
|
30
|
+
## API keys
|
|
31
|
+
|
|
32
|
+
Supabase Lite issues opaque `sb_publishable_*` / `sb_secret_*` keys, matching Supabase's current key format — generated per project, never hardcoded. `lite init` generates any missing key(s) into root `.env` (`SUPABASE_PUBLISHABLE_KEY` / `SUPABASE_SECRET_KEY`, per-variable — an existing one is never overwritten) and wires `config.toml`'s `auth.publishable_key` / `auth.secret_key` to reference them via `env(VAR)` (same field names as the upstream `supabase` CLI). `lite generate-keys` (re)generates the whole pair; `lite start`/`lite dev` print the resolved keys.
|
|
33
|
+
|
|
34
|
+
`sb_publishable_*` authenticates as `anon`, `sb_secret_*` as `service_role` (bypasses RLS, including on SQLite). Enforcement on `/rest/v1` and `/auth/v1` is opt-in: it activates once at least one key is configured — an unconfigured key simply never matches, and an unconfigured project keeps the old behavior (any/no `apikey` accepted). Keys must arrive via the `apikey` header or `?apikey=` query param (what `supabase-js` sends automatically); a key sent only via `Authorization` is rejected, matching upstream self-hosted conformance. A real user session JWT in `Authorization` always outranks the API key. A secret key rejected from a browser `User-Agent` mirrors the hosted gateway's browser guard. Legacy JWT-as-apikey (the old `ANON_KEY`/`SERVICE_ROLE_KEY` HS256 tokens) is not supported.
|
|
35
|
+
|
|
36
|
+
`/storage/v1` is transform-only, like upstream self-hosted Kong: it never 401s on a missing/invalid key (public objects, signed URLs, and S3 presigned flows stay keyless), but a secret key still satisfies storage's own authed routes as `service_role`.
|
|
37
|
+
|
|
38
|
+
The OpenAPI root (`GET /rest/v1/`) requires the secret key, mirroring upstream's admin-only ACL on that route: a publishable key gets 403, the secret key gets 200.
|
|
39
|
+
|
|
40
|
+
There is one exception to enforcement, and it only exists locally: [admin mode](/running#admin-mode). `lite dev` and `lite start` serve keyless `/rest/v1` and `/storage/v1` requests as `service_role`, so the browser studio can do admin work without a secret key shipping to the browser (which the browser guard would reject anyway). The Vite dev server does the same for `/rest/v1`; it does not mount `/storage/v1` unless you add it to the plugin's `prefixes`. Only same-origin requests on a loopback socket **and** a loopback hostname are elevated — that pairing is what blocks both LAN peers spoofing `Host` and DNS rebinding — and any request carrying a key or an `Authorization` header keeps its normal role. Turn it off with `--no-admin`; it is off by default for embedders and in `vite preview`.
|
|
41
|
+
|
|
42
|
+
Embedders using the `App` class directly can disable enforcement (`options.server.apiKeys: false`) or supply a custom resolver (`options.server.apiKeys.resolver`); `app.getClient()` defaults to the configured publishable key. See `STATUS.md` (`#api-keys`) in the installed package for the full behavior matrix.
|
|
43
|
+
|
|
44
|
+
## What's shared with the Data API
|
|
45
|
+
|
|
46
|
+
Auth issues the JWTs that Row Level Security reads. `auth.uid()`, `auth.role()`, and `auth.jwt()` in your RLS policies resolve from the same token this Auth API signs, on every backend. See [Database: RLS](/database/rls) for how policies consume these claims, and [Database backends](/database/backends) for switching between SQLite, PGlite, and Postgres.
|
|
47
|
+
|
|
48
|
+
<Aside type="note">
|
|
49
|
+
This page tracks capability-level rollups. The package installed in your project ships an exact method-by-method matrix in `STATUS.md` that updates every `npm install`. Treat that file as the source of truth for exact counts. See also [Compatibility](/compatibility).
|
|
50
|
+
</Aside>
|
|
51
|
+
|
|
52
|
+
For the Auth concepts that behave identically to upstream (JWT structure, session lifecycle, GoTrue's general model), see the [Supabase Auth docs](https://supabase.com/docs/guides/auth).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Supported auth flows"
|
|
3
|
+
description: "The 13 GoTrue-compatible Auth endpoints Supabase Lite implements, with supabase-js examples."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
Each method below hits a real backend endpoint at `/auth/v1/*` and behaves like upstream GoTrue for the cases it covers. Session issuance, refresh-token rotation (with reuse detection and revocation), and password hashing are all implemented, not stubbed.
|
|
9
|
+
|
|
10
|
+
| `supabase-js` method | Endpoint | Notes |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| [`signUp()`](https://supabase.com/docs/reference/javascript/auth-signup) | `POST /signup` | Email/password, optional metadata, email confirmation |
|
|
13
|
+
| [`signInWithPassword()`](https://supabase.com/docs/guides/auth/passwords) | `POST /token?grant_type=password` | Returns JWT + refresh token |
|
|
14
|
+
| [`signInWithOtp()`](https://supabase.com/docs/guides/auth/auth-email-otp) | `POST /otp` | Magic link / OTP via email |
|
|
15
|
+
| [`verifyOtp()`](https://supabase.com/docs/reference/javascript/auth-verifyotp) | `POST /verify` | signup, magiclink, recovery, email_change, reauthentication. Both the numeric code (`{ email, token }`) and the link's `token_hash` verify against the DB |
|
|
16
|
+
| [`refreshSession()`](https://supabase.com/docs/reference/javascript/auth-refreshsession) | `POST /token?grant_type=refresh_token` | Token rotation, immediate-reuse compatibility, session expiry checks |
|
|
17
|
+
| [`signOut()`](https://supabase.com/docs/reference/javascript/auth-signout) | `POST /logout` | Scopes: `local`, `global`, `others` |
|
|
18
|
+
| [`getUser()`](https://supabase.com/docs/reference/javascript/auth-getuser) | `GET /user` | JWT-authenticated |
|
|
19
|
+
| [`updateUser()`](https://supabase.com/docs/reference/javascript/auth-updateuser) | `PUT /user` | Metadata, password, email change |
|
|
20
|
+
| [`resetPasswordForEmail()`](https://supabase.com/docs/reference/javascript/auth-resetpasswordforemail) | `POST /recover` | Password reset email (client method wraps the `recover` endpoint) |
|
|
21
|
+
| [`resend()`](https://supabase.com/docs/reference/javascript/auth-resend) | `POST /resend` | Resend confirmation / email change |
|
|
22
|
+
| [`reauthenticate()`](https://supabase.com/docs/reference/javascript/auth-reauthenticate) | `GET /reauthenticate` | Request a reauthentication nonce |
|
|
23
|
+
| [`signInWithOAuth()`](https://supabase.com/docs/guides/auth/social-login) | `GET /authorize` | `github` and `google` only; redirects into the provider's consent screen (PKCE or implicit flow) |
|
|
24
|
+
| [`exchangeCodeForSession()`](https://supabase.com/docs/reference/javascript/auth-exchangecodeforsession) | `GET`/`POST /callback`, `POST /token?grant_type=pkce` | Completes the OAuth handshake; automatic account linking when the provider email matches an existing verified user |
|
|
25
|
+
|
|
26
|
+
## Email/password
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { createClient } from "@supabase/supabase-js";
|
|
30
|
+
|
|
31
|
+
const supabase = createClient("http://localhost:54321", "<anon-key>");
|
|
32
|
+
|
|
33
|
+
await supabase.auth.signUp({
|
|
34
|
+
email: "user@example.com",
|
|
35
|
+
password: "correct-horse-battery-staple",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const { data, error } = await supabase.auth.signInWithPassword({
|
|
39
|
+
email: "user@example.com",
|
|
40
|
+
password: "correct-horse-battery-staple",
|
|
41
|
+
});
|
|
42
|
+
// data.session.access_token is a JWT; RLS policies read auth.uid() from it.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Email OTP / magic link
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
await supabase.auth.signInWithOtp({ email: "user@example.com" });
|
|
49
|
+
|
|
50
|
+
// after the user receives the code/link:
|
|
51
|
+
const { data, error } = await supabase.auth.verifyOtp({
|
|
52
|
+
email: "user@example.com",
|
|
53
|
+
token: "123456",
|
|
54
|
+
type: "email",
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The 6-digit code is emailed and verified against the database, so it works with any email driver and across isolates (e.g. Cloudflare Workers) — no in-memory state. Emailed links point at `GET /auth/v1/verify`, which verifies the token and redirects to your `redirect_to`. See [Email delivery & templates](/auth/email) to configure the sender, subjects, and HTML.
|
|
59
|
+
|
|
60
|
+
<Aside>
|
|
61
|
+
Set `[auth.email] enable_confirmations = false` in `config.toml` for local dev so `signUp()` returns an active session immediately instead of waiting on a confirmation email.
|
|
62
|
+
</Aside>
|
|
63
|
+
|
|
64
|
+
## OAuth / social sign-in
|
|
65
|
+
|
|
66
|
+
Both the authorization-code (PKCE) and implicit flows are supported. Which one you get depends on the client's `flowType`, which `supabase-js` defaults to `"implicit"` — set `flowType: "pkce"` explicitly to opt into PKCE.
|
|
67
|
+
|
|
68
|
+
### Implicit (the `supabase-js` default)
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const supabase = createClient("http://localhost:54321", "<anon-key>");
|
|
72
|
+
// flowType defaults to "implicit"
|
|
73
|
+
|
|
74
|
+
await supabase.auth.signInWithOAuth({ provider: "github" });
|
|
75
|
+
// or provider: "google"
|
|
76
|
+
|
|
77
|
+
// the redirect back to your `redirect_to` URL carries the session in the
|
|
78
|
+
// fragment (`#access_token=...`); supabase-js reads it automatically via
|
|
79
|
+
// `detectSessionInUrl` (also on by default) — do not call
|
|
80
|
+
// `exchangeCodeForSession()` here.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### PKCE, handled automatically
|
|
84
|
+
|
|
85
|
+
With `flowType: "pkce"` and the default `detectSessionInUrl: true`, the browser client redeems the `?code=...` param itself as soon as the callback page loads. This is the path to use in a browser app — no exchange call of your own:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
const supabase = createClient("http://localhost:54321", "<anon-key>", {
|
|
89
|
+
auth: { flowType: "pkce" },
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
await supabase.auth.signInWithOAuth({ provider: "github" });
|
|
93
|
+
|
|
94
|
+
// on the redirect back, supabase-js exchanges the `?code=...` param and stores
|
|
95
|
+
// the session; just wait for it:
|
|
96
|
+
const { data } = await supabase.auth.getSession();
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### PKCE, exchanged manually
|
|
100
|
+
|
|
101
|
+
Only call `exchangeCodeForSession()` yourself when you own the callback handling — a server-side route, or a custom client flow. Turn detection off on that client, otherwise it races your call and one of the two attempts fails against the single-use code:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const supabase = createClient("http://localhost:54321", "<anon-key>", {
|
|
105
|
+
auth: { flowType: "pkce", detectSessionInUrl: false },
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
await supabase.auth.signInWithOAuth({ provider: "github" });
|
|
109
|
+
|
|
110
|
+
// the redirect back to your `redirect_to` URL carries a `?code=...` query param:
|
|
111
|
+
const { data, error } = await supabase.auth.exchangeCodeForSession(code);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
<Aside>
|
|
115
|
+
Auth codes are single-use. Never combine `detectSessionInUrl: true` with your own `exchangeCodeForSession()` call — the second redemption fails. And calling `exchangeCodeForSession(code)` against an implicit-flow redirect fails outright: there's no `?code` param, only fragment tokens. Match the exchange call to the client's configured `flowType`.
|
|
116
|
+
</Aside>
|
|
117
|
+
|
|
118
|
+
Only `github` and `google` are implemented; enabling any other configured provider (including `apple`) returns "provider ... is not yet implemented". If a provider's email matches an existing verified user, the identity is linked to that account automatically — there's no separate `linkIdentity()` step for this case. See [Not supported](/auth/not-supported) for the providers and manual linking gaps.
|
|
119
|
+
|
|
120
|
+
For everything these flows behave identically to upstream on (JWT claims shape, GoTrue error codes, cookie/session storage on the client), see the [Supabase Auth guide](https://supabase.com/docs/guides/auth), [password auth](https://supabase.com/docs/guides/auth/passwords), [email OTP](https://supabase.com/docs/guides/auth/auth-email-otp), and [social login](https://supabase.com/docs/guides/auth/social-login) docs. For what's missing, see [Not supported](/auth/not-supported).
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI overview"
|
|
3
|
+
description: "The lite CLI versus the supabase CLI: parity, gaps, and what's still experimental."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside, Tabs, TabItem } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
The `lite` CLI is a small, in-process CLI for local Supabase Lite projects. It mirrors the shape of the upstream [Supabase CLI](https://supabase.com/docs/reference/cli/introduction) (command names, `supabase/` layout, `config.toml` format) but implements only what Supabase Lite needs: there is no Docker stack, no shadow database, and no diff-engine orchestration behind it.
|
|
9
|
+
|
|
10
|
+
<Aside type="note">
|
|
11
|
+
Command names are aligned to `supabase` CLI v2.98.2. Lite-only commands (`dev`, `repl`, `debug`, `upgrade`) have no upstream equivalent.
|
|
12
|
+
</Aside>
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Install globally to expose the `lite` binary system-wide:
|
|
17
|
+
|
|
18
|
+
<Tabs sync="pkg-manager">
|
|
19
|
+
<TabItem label="bun">
|
|
20
|
+
```bash
|
|
21
|
+
bun add -g @supabase/lite
|
|
22
|
+
```
|
|
23
|
+
</TabItem>
|
|
24
|
+
<TabItem label="npm">
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @supabase/lite
|
|
27
|
+
```
|
|
28
|
+
</TabItem>
|
|
29
|
+
<TabItem label="pnpm">
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add -g @supabase/lite
|
|
32
|
+
```
|
|
33
|
+
</TabItem>
|
|
34
|
+
</Tabs>
|
|
35
|
+
|
|
36
|
+
Or install per-project and run it through your package manager's runner (`bunx lite <cmd>`, `npx lite <cmd>`, `pnpm exec lite <cmd>`).
|
|
37
|
+
|
|
38
|
+
## Parity table
|
|
39
|
+
|
|
40
|
+
| Command | lite | supabase | Notes |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| `init` | Yes | Yes | Scaffolds `supabase/` (config, schema, seed, data dir); generates any missing API key(s) into `.env`. Flags differ from upstream. |
|
|
43
|
+
| `generate-keys` | Yes (lite-only) | No | (Re)generates the publishable/secret API key pair and upserts `.env`. |
|
|
44
|
+
| `dev` | Yes (lite-only) | No | Starts the server and watches `schemas/*.sql`, auto-applying on change. Scaffolds the project first if `supabase/` is absent, so it works in an empty directory. |
|
|
45
|
+
| `start` | Yes | Yes | In-process, no watch, no auto-migrate. Requires `lite init` first: upstream runs without a `config.toml`, but lite is code-first and has no Studio to build a schema in an empty database. No Docker stack flags (`-x`, `--ignore-health-check`). |
|
|
46
|
+
| `stop` | No | Yes | Not registered. There's no long-running Docker stack to stop. |
|
|
47
|
+
| `repl` | Yes (lite-only) | No | Interactive REPL with `app`, `client`, `conn`, `db` in scope. |
|
|
48
|
+
| `debug` | Yes (lite-only) | No | Dumps runtime/config info. |
|
|
49
|
+
| `upgrade` | Yes (lite-only) | No | Migrates a Supabase Lite project to hosted or local Supabase. See [Upgrade](/upgrade). |
|
|
50
|
+
| `bootstrap` | No | Yes | Not planned; starter-template scaffolding stays with the upstream CLI. |
|
|
51
|
+
| `db schema` | Yes (lite-only) | No | Prints current DB schema; `--diff` compares against `schemas/*.sql`. |
|
|
52
|
+
| `db diff` | Yes | Yes | Emits a pg-DDL migration from the declarative schema diff. `--local` semantics only, single engine (no migra/pg-delta/pgAdmin choice, no shadow DB). |
|
|
53
|
+
| `db query` | Yes | Yes (as `db query`, previously top-level `exec`) | Runs a SQL statement, from an argument or stdin, against the local DB; splits multi-statement input. Suppresses CLI chrome by default so it's pipeable (`--verbose` prints chrome to stderr). Supports `--remote` and `--config`. |
|
|
54
|
+
| `db translate` | Yes (lite-only) | No | Translate Postgres SQL to the backend dialect (arg or stdin). Composes with `db query` via a pipe. |
|
|
55
|
+
| `db reset` | Yes | Yes | Drops everything, replays migrations, runs seed. Does not apply declarative `schema_paths`. |
|
|
56
|
+
| `db push` | No | Yes | Not registered; use `lite cloud deploy` (experimental) instead. |
|
|
57
|
+
| `db pull` | No | Yes | Not registered. |
|
|
58
|
+
| `db dump` | No | Yes | Not registered. |
|
|
59
|
+
| `db lint` | No | Yes | Not registered. |
|
|
60
|
+
| `db advisors` | No | Yes | Not registered. |
|
|
61
|
+
| `db start` | No | Yes | Not applicable; there's no separate DB process to start. |
|
|
62
|
+
| `migration new` | Yes | Yes | Creates an empty migration file in `supabase/migrations/`. |
|
|
63
|
+
| `migration up` | Yes | Yes (as `migration up`, no direct upstream verb of the same name for local apply) | Applies pending migrations; `--dry-run` previews without applying. |
|
|
64
|
+
| `migration list` | Yes | Yes | Shows applied vs. pending migrations. |
|
|
65
|
+
| `migration down` | No | Yes | Not registered. |
|
|
66
|
+
| `migration repair` | No | Yes | Not registered. |
|
|
67
|
+
| `migration squash` | No | Yes | Not registered. |
|
|
68
|
+
| `migration fetch` | No | Yes | Not registered. |
|
|
69
|
+
| `login` / `logout` | Experimental | Yes | Email/password against Supabase Lite cloud, not the Supabase Management API. |
|
|
70
|
+
| `link` / `unlink` | Experimental | Yes | Parity at the verb level; `link` has no `--password`/`--skip-pooler`. |
|
|
71
|
+
| `status` | Experimental | Yes | Shows linked project metadata, not Docker container status. |
|
|
72
|
+
| `signup` / `whoami` | Experimental (lite-only) | No | Register/inspect a Supabase Lite cloud account. |
|
|
73
|
+
| `cloud deploy` | Experimental (lite-only) | No | Pushes schema/config/seed to a linked Supabase Lite cloud project (renamed from `push`). |
|
|
74
|
+
| `cloud diff` | Experimental (lite-only) | No | Diffs local against the linked remote. |
|
|
75
|
+
| `projects list` / `create` | Experimental | Yes | Flags differ (no `--org-id`/`--region`). |
|
|
76
|
+
| `projects api-keys` / `delete` | No | Yes | Not registered. |
|
|
77
|
+
| `functions *` | No | Yes | Edge Functions are not implemented yet. |
|
|
78
|
+
| `gen types` / `gen signing-key` | No | Yes | Not implemented yet. |
|
|
79
|
+
| `seed buckets` | No | Yes | Depends on Storage RLS/role support landing first. |
|
|
80
|
+
| `test db` / `test new` | No | Yes | Not applicable on SQLite (no pgTAP). |
|
|
81
|
+
| `services` | No | Yes | Not applicable; there's no Docker stack to list. |
|
|
82
|
+
| Management API groups (`orgs`, `secrets`, `branches`, `domains`, `sso`, `backups`, `snippets`, `postgres-config`, `network-*`, `encryption`, `inspect`, `storage`, `telemetry`) | No | Yes | Deferred; none registered, to keep `--help` output clean. Re-evaluated as Supabase Lite cloud grows a matching surface. |
|
|
83
|
+
|
|
84
|
+
## What's missing, in one place
|
|
85
|
+
|
|
86
|
+
If you're coming from the `supabase` CLI, these upstream capabilities have no lite equivalent today:
|
|
87
|
+
|
|
88
|
+
- **Docker-backed commands**: `stop`, `db start`, `services`. There's no container stack.
|
|
89
|
+
- **`db` toolbox**: `push`, `pull`, `dump`, `lint`, `advisors` are not registered.
|
|
90
|
+
- **`migration` toolbox**: `down`, `repair`, `squash`, `fetch` are not registered.
|
|
91
|
+
- **`functions`**: Edge Functions aren't implemented.
|
|
92
|
+
- **`gen`**: no type generation yet.
|
|
93
|
+
- **`seed buckets`, `bootstrap`, `test db`/`test new`**: not planned or blocked on other features.
|
|
94
|
+
- Every Management API group (`orgs`, `secrets`, `branches`, `sso`, `backups`, `snippets`, `postgres-config`, `network-*`, `encryption`, `inspect`, `storage`, `telemetry`): deferred pending Supabase Lite cloud.
|
|
95
|
+
|
|
96
|
+
## Experimental commands
|
|
97
|
+
|
|
98
|
+
`login`, `logout`, `status`, `link`, `unlink`, `signup`, `whoami`, the `cloud` group, and `projects list`/`create` are gated behind Supabase Lite's own experimental flag and talk to **Supabase Lite cloud**, not the Supabase Management API. They print an experimental warning when run. Treat them as unstable: names and flags may change before 1.0.
|
|
99
|
+
|
|
100
|
+
## Common flags
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
lite init --pglite # scaffold with PGlite instead of SQLite
|
|
104
|
+
lite db reset --hard # delete the DB file, replay migrations + seed
|
|
105
|
+
lite db schema --diff # diff current DB vs schemas/*.sql
|
|
106
|
+
lite db schema --sql # print raw CREATE statements
|
|
107
|
+
lite db diff -f tweak # emit a migration from the schema diff
|
|
108
|
+
cat supabase/seed.sql | lite db translate | lite db query # translate + apply ad-hoc SQL
|
|
109
|
+
lite db query "select count(*) from todos"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
See [Migrations](/database/migrations) for the migration workflow and [Database backends](/database/backends) for `--pglite`/driver selection. For the full upstream command reference, see the [Supabase CLI reference](https://supabase.com/docs/reference/cli/introduction).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Telemetry"
|
|
3
|
+
description: "The lite CLI sends anonymous usage telemetry by default. How to disable it."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
The `lite` CLI sends anonymous usage telemetry by default, to help prioritize fixes and features.
|
|
9
|
+
|
|
10
|
+
<Aside type="note">
|
|
11
|
+
No personally identifiable information is collected: no file paths, project names, DB URLs, env values, hostnames, IPs, or stack traces.
|
|
12
|
+
</Aside>
|
|
13
|
+
|
|
14
|
+
What's collected: the command name, which CLI flags were present (boolean presence only, never values), runtime (`node`/`bun`/`deno`), Node version, platform/arch, CI/agent/container detection, DB driver (`sqlite`/`sqlite-postgres`/`pglite`/`postgres`), DB location (`file`/`memory`/`local`/`remote`), and a DB size bucket.
|
|
15
|
+
|
|
16
|
+
## Opt out
|
|
17
|
+
|
|
18
|
+
Any of these disables telemetry:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
lite --no-telemetry <cmd>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
LITE_TELEMETRY=0 lite <cmd>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
DO_NOT_TRACK=1 lite <cmd>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`DO_NOT_TRACK` follows the [consoledonottrack.com](https://consoledonottrack.com) convention, so it also applies if you already set it globally to opt out of telemetry across other CLIs.
|
|
33
|
+
|
|
34
|
+
This is a Supabase Lite-specific concern with no direct upstream page; see the [Supabase CLI reference](https://supabase.com/docs/reference/cli/introduction) for the CLI it mirrors.
|