Profiles
profilesA profile per user, created on sign-up from auth metadata with a unique username, an email mirror, column-level update grants and a guard on columns the service owns.
Tenancy & accountsmanagedcustom
Install
It needs no other module.
npx better-supabase add profilesConfigure
The blocks entries in your config, with the default mode.
import { defineConfig } from "better-supabase/config";
export default defineConfig({
blocks: {
// Modes: "managed", "custom". The default is "managed".
profiles: { mode: "managed" },
},
});Migrations
The files
npx better-supabase add profiles writes into your declarative schema with the default layout.Client
This block has no React entry yet. Its TypeScript side is in better-supabase/blocks/profiles, which runs on the server.
Events
With the outbox installed, the module writes these in the same transaction as the change.
This module writes no outbox events.
Dependencies
Recipes
More in Tenancy & accounts
- Tenant memberships and permission helpermembershipsMemberships with roles, member_organization_ids() and has_organization_role() for RLS policies, and membership_claims() for the access token hook. Adopt an existing memberships table through blocks.memberships.
- Invitationsinvitationsinvite_member(tenant, email, role) returns a single-use token whose hash is stored; accept_invitation(token) checks the signed-in user's confirmed email and, again, the inviter's authority. Roles follow the access model; a null tenant invites to a platform role, stored in platform_invitations.
- Reserved slugsreserved-slugsA slug format and length check and a list of reserved words (admin, api, www, ...), enforced by a trigger.
- Organizationsorganizationscreate_organization(attrs) with slug rules and an after-create hook, a deferred owner check, an assignment ceiling, and member functions (role change, remove, leave, transfer ownership) on the access contract.React hooks
- SettingssettingsPer-user, per-organization and platform-wide settings as key-value jsonb rows. Users read and write their own; organization settings check settings.read and settings.update; platform settings check a platform permission per key. Keys with a JSON Schema in options.schemas get a pg_jsonschema check.React hooks
- TeamsteamsTenant teams and their members. Inbox assignment uses these rows instead of its own team tables.