@plutocms/supabase 0.29.0 → 0.30.0
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/CHANGELOG.md +12 -0
- package/README.md +11 -111
- package/app/plugins/pluto-extension.ts +2 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.30.0](https://github.com/plutocms/supabase/compare/v0.29.0...v0.30.0) (2026-11-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* the post editor look of core, a line icon for the backend badge, shop translations ([#293](https://github.com/plutocms/supabase/issues/293)) ([96f582b](https://github.com/plutocms/supabase/commit/96f582b261524fa9511d1f32451ae8a801dcc3b1))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* declare the MIT license of supabase and supabase-shop; short READMEs ([#289](https://github.com/plutocms/supabase/issues/289)) ([d9b0745](https://github.com/plutocms/supabase/commit/d9b07459d1315bc75e8188535c8db0d2f9212399))
|
|
14
|
+
|
|
3
15
|
## [0.29.0](https://github.com/plutocms/supabase/compare/v0.28.0...v0.29.0) (2026-11-08)
|
|
4
16
|
|
|
5
17
|
|
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# Supabase Layer for Pluto
|
|
2
2
|
|
|
3
|
-
This layer
|
|
3
|
+
This layer makes Supabase the backend of Pluto: the database, the sign-in, the users, and the roles.
|
|
4
|
+
|
|
5
|
+
**Docs:** [Supabase](https://pluto.vulmix.dev/docs/supabase)
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
> [!NOTE]
|
|
8
|
-
> Make sure you have a Supabase project set up. You
|
|
10
|
+
> Make sure you have a Supabase project set up. You need the URL and the publishable key of the project. You can find these in your [Supabase dashboard](https://supabase.com/dashboard).
|
|
9
11
|
|
|
10
12
|
1. Create a `.env` file in the root of your project and add the following environment variables:
|
|
11
13
|
|
|
@@ -30,117 +32,15 @@ export default defineNuxtConfig({
|
|
|
30
32
|
})
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
### Composables
|
|
36
|
-
|
|
37
|
-
This layer provides the following composables:
|
|
38
|
-
|
|
39
|
-
- `useAuth`: Sign in, request a password reset, and update the password, with Supabase.
|
|
40
|
-
|
|
41
|
-
### Admin shell
|
|
42
|
-
|
|
43
|
-
Pluto core owns the admin shell: the `/admin` route, the sign-in page, the route guard and the
|
|
44
|
-
top navbar. This layer registers an auth driver, and core renders the shell from it. See
|
|
45
|
-
`.claude/skills/auth-driver/SKILL.md`.
|
|
46
|
-
|
|
47
|
-
An app that overrode `NavbarAdmin` or `pages/admin.vue` of an older version must move to registry
|
|
48
|
-
entries. See "Migrating an app" in that skill.
|
|
49
|
-
|
|
50
|
-
### Invite users (access API)
|
|
51
|
-
|
|
52
|
-
An admin invites a user by email and gives the user one or more roles. The routes are under
|
|
53
|
-
`/api/_pluto/supabase/access/**`. Every write needs an admin. This needs the migration
|
|
54
|
-
`008_users_and_roles_admin.sql`, which the admin applies from `/admin/migrations`.
|
|
55
|
-
|
|
56
|
-
Invites need no setup. Check one thing: in the Supabase dashboard (Authentication, then URL
|
|
57
|
-
Configuration), the **Site URL** is the URL of your site. Supabase accepts every link back to that
|
|
58
|
-
host, so `/admin/accept-invite` needs no entry in the Redirect URLs. Add a Redirect URL only for
|
|
59
|
-
another host (for example a preview deploy, or `www.` next to the bare domain).
|
|
60
|
-
|
|
61
|
-
How the invite email goes out:
|
|
62
|
-
|
|
63
|
-
- **Without the service role key** (the default): the server sends a passwordless sign-in link
|
|
64
|
-
with the public key. Supabase creates the account and uses its sign-up or magic link email
|
|
65
|
-
template. Public sign-up must be on (the Supabase default). Supabase sends one email per
|
|
66
|
-
address every 60 seconds.
|
|
67
|
-
- **With the service role key** (optional): set `NUXT_SUPABASE_SECRET_KEY` (the Supabase secret
|
|
68
|
-
key) in the environment of the **running server**. Never put it in the build environment. The
|
|
69
|
-
server then uses Supabase's invite API and the "Invite user" email template. This also works
|
|
70
|
-
when public sign-up is off.
|
|
71
|
-
|
|
72
|
-
Optional: a custom invite email template (Authentication, then Email Templates, then Invite
|
|
73
|
-
user) makes the link work in every browser, because the page then reads a `token_hash` and not
|
|
74
|
-
tokens in the URL hash:
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
{{ .SiteURL }}/admin/accept-invite?token_hash={{ .TokenHash }}&type=invite
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
The built-in Supabase mailer sends very few emails, and only to members of your Supabase
|
|
81
|
-
organization. To invite any other address, set up custom SMTP (Project Settings, then
|
|
82
|
-
Authentication, then SMTP). A production site needs it anyway, for every auth email. Without it,
|
|
83
|
-
an invite to another address answers 400 with the hint `emailNotAuthorized`.
|
|
84
|
-
|
|
85
|
-
The invited user opens the link, sets a password on `/admin/accept-invite`, and goes to the
|
|
86
|
-
admin. An invite to an email that already has an account adds the roles and sends no email.
|
|
87
|
-
|
|
88
|
-
#### Invites through Pluto mail (optional)
|
|
89
|
-
|
|
90
|
-
With the service role key **and** a working Pluto mail driver, an invite does not use Supabase's
|
|
91
|
-
mailer. The server makes a one-time link with `auth.admin.generateLink`, and Pluto mail sends the
|
|
92
|
-
email. This lifts the team-only address rule and the Supabase email rate limit for invites. Set
|
|
93
|
-
the mail variables in the environment of the **running server** (Resend is the first driver):
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
NUXT_PLUTO_MAIL_RESEND_API_KEY=re_...
|
|
97
|
-
NUXT_PLUTO_MAIL_FROM="Your Site <hello@your-domain.com>"
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
`Settings > Email` in the admin guides the setup (account, key, domain, test email). The
|
|
101
|
-
`mail` skill of `@plutocms/core` lists every `NUXT_PLUTO_MAIL_*` variable. If the send fails,
|
|
102
|
-
the user and the roles stay, and the admin gets the invite link to send by hand.
|
|
103
|
-
|
|
104
|
-
With the key, an admin can also copy the invite link (Users, then the row menu, or the invite
|
|
105
|
-
form). The link works once and expires. Sign-up, password reset and magic link emails still
|
|
106
|
-
come from Supabase. The Email tab has a guide to send them through Resend too.
|
|
107
|
-
|
|
108
|
-
### API Routes
|
|
109
|
-
|
|
110
|
-
The layer includes API routes for interacting with Supabase services, such as authentication and settings.
|
|
111
|
-
Every route lives under `/api/_pluto/supabase/`. Core blocks a cross-site write to `/api/_pluto/**`, so
|
|
112
|
-
a page of another site cannot call them. A failure is an HTTP error with a translation key, never a
|
|
113
|
-
`200` with `success: false`. These routes serve the admin. They are not a public API.
|
|
114
|
-
|
|
115
|
-
### Public content API
|
|
116
|
-
|
|
117
|
-
The public content of the Supabase layers is read through the public API of core,
|
|
118
|
-
`GET /api/pluto/v1/content/<type>` (and `/<id or slug>`). See
|
|
119
|
-
[the public API](https://pluto.vulmix.dev/docs/build/public-api). The routes are anonymous. This layer
|
|
120
|
-
reads for them with an anon client that has no user session, so Row Level Security applies as for
|
|
121
|
-
an anonymous visitor, and the answer is the same for everyone. A CDN can cache it. The adapter
|
|
122
|
-
never uses the service role key for a read. The adapter also supports the `filters` of a public
|
|
123
|
-
query, and puts the created, updated and published-at columns on each item, so a public list can
|
|
124
|
-
sort by date.
|
|
125
|
-
|
|
126
|
-
- GET and PUT `/api/_pluto/supabase/settings` (PUT needs `settings:manage`; it answers `{ message, data }`)
|
|
127
|
-
- POST `/api/_pluto/supabase/auth/signup`
|
|
128
|
-
- GET `/api/_pluto/supabase/migrations`, POST `/api/_pluto/supabase/migrations/run` (admin)
|
|
129
|
-
- GET `/api/_pluto/supabase/me/capabilities`
|
|
130
|
-
- GET and PUT `/api/_pluto/supabase/me/locale`
|
|
131
|
-
- GET `/api/_pluto/supabase/setup` (the setup state), POST `/api/_pluto/supabase/setup` (runs the first setup)
|
|
132
|
-
- GET `/api/_pluto/supabase/access/users`, GET `/api/_pluto/supabase/access/roles` (permission `users:read`)
|
|
133
|
-
- POST `/api/_pluto/supabase/access/users/invite`, POST `/api/_pluto/supabase/access/users/:id/resend` (admin; `locale` is the
|
|
134
|
-
optional language of the email)
|
|
135
|
-
- POST `/api/_pluto/supabase/access/users/invite-link` (admin; needs the service role key; returns a one-time link
|
|
136
|
-
and sends no email)
|
|
137
|
-
- GET `/api/_pluto/supabase/access/capabilities` (admin; says whether the service key and Pluto mail are set)
|
|
138
|
-
- PUT and DELETE `/api/_pluto/supabase/access/users/:id/roles` (admin; DELETE revokes the access)
|
|
139
|
-
- POST `/api/_pluto/supabase/access/roles`, PUT and DELETE `/api/_pluto/supabase/access/roles/:key` (admin)
|
|
35
|
+
## What it adds
|
|
140
36
|
|
|
141
|
-
|
|
37
|
+
- **Content in Postgres:** a content adapter for the content types of every layer, with history, trash, scheduled publish, and a server copy of unsaved changes. See [Content adapter](https://pluto.vulmix.dev/docs/supabase/content-adapter).
|
|
38
|
+
- **Sign-in:** email and password with Supabase Auth, and the auth driver of the admin. See [Auth](https://pluto.vulmix.dev/docs/supabase/auth).
|
|
39
|
+
- **Users and roles:** invite users by email, and give roles that hold capabilities. See [Users and roles](https://pluto.vulmix.dev/docs/supabase/users-and-roles) and [Invites and email](https://pluto.vulmix.dev/docs/supabase/invites-and-email).
|
|
40
|
+
- **Media:** the media library of core stores its files in Supabase Storage.
|
|
41
|
+
- **Migrations:** each layer ships its database changes. An admin applies them from `/admin/migrations`. See [Migrations](https://pluto.vulmix.dev/docs/supabase/migrations).
|
|
142
42
|
|
|
143
|
-
|
|
43
|
+
The public site reads the content through the [public API](https://pluto.vulmix.dev/docs/build/public-api) of core. The routes under `/api/_pluto/supabase/` serve the admin. They are not a public API.
|
|
144
44
|
|
|
145
45
|
## Development
|
|
146
46
|
|
|
@@ -161,7 +161,8 @@ export default defineNuxtPlugin(() => {
|
|
|
161
161
|
id: 'supabase',
|
|
162
162
|
kind: 'database',
|
|
163
163
|
label: 'Supabase',
|
|
164
|
-
icon
|
|
164
|
+
// Official backends use a Lucide line icon (see the admin-shell skill in pluto).
|
|
165
|
+
icon: 'i-lucide-database-zap',
|
|
165
166
|
details: SupabaseBackendDetails,
|
|
166
167
|
},
|
|
167
168
|
// The pending-migrations notice, shown at the top of the admin pages.
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plutocms/supabase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
5
5
|
"description": "Supabase backend layer for Pluto",
|
|
6
6
|
"author": "Victor Ribeiro",
|
|
7
|
+
"license": "MIT",
|
|
7
8
|
"homepage": "https://github.com/plutocms/supabase/tree/main/packages/supabase#readme",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|