Functions

create-project

fn (request: CreateProjectRequest): Project

Create a new Supabase project. region must be a valid AWS region (e.g. "us-east-1", "eu-west-1"). plan defaults to "free".

Example

::projects ::supabase::admin::projects

project ::projects/create-project(::projects/CreateProjectRequest({
  name: "My New App",
  organization_id: "org-abc-123",
  region: "us-east-1",
  db_pass: "secureDbPassword123!"
}))
project.id  // => "new-project-ref"

database-openapi-path

fn (project-ref: Str, schema: Str?): Str

delete-project

fn (project-ref: Str): Map

Delete a Supabase project. This is permanent and cannot be undone.

get-api-keys

fn (project-ref: Str): Vec

Get the API keys (anon, service_role) for a project.

Example

::projects ::supabase::admin::projects

keys ::projects/get-api-keys("my-project-ref")
// => [{name: "anon", api_key: "eyJ..."}, {name: "service_role", api_key: "eyJ..."}]

get-auth-config

fn (project-ref: Str): Map

Get the authentication (GoTrue) configuration for a project.

get-database-openapi

fn (project-ref: Str): Map
fn (project-ref: Str, schema: Str?): Map

Get the PostgREST OpenAPI spec for a project. Optionally pass a database schema.

get-postgrest-config

fn (project-ref: Str): Map

Get the PostgREST configuration for a project (exposed schemas, max rows, pool size).

get-project

fn (project-ref: Str): Project

Get details for a specific project by its reference ID.

get-project-health

fn (project-ref: Str): Vec
fn (project-ref: Str, services: Vec): Vec

Get health status for project services. Defaults to db, auth, storage, rest, and realtime.

get-project-usage

fn (project-ref: Str): Map

Get usage metrics for a project (database size, storage, bandwidth, etc.).

health-path

fn (project-ref: Str, services: Vec): Str

list-projects

fn (): Vec

List all Supabase projects the authenticated user has access to.

Example

::projects ::supabase::admin::projects

projects ::projects/list-projects()
// => [{id: "abc", name: "My App", organization_id: "org-123", region: "us-east-1", ...}, ...]

ns alias

Alias of ::supabase::admin::projects/

pause-project

fn (project-ref: Str): Map

Pause a project (free tier only). Paused projects stop all services but retain data.

postgrest-path

fn (project-ref: Str): Str

restore-project

fn (project-ref: Str): Map

Restore a paused project.

update-auth-config

fn (project-ref: Str, config: Map): Map

Update authentication configuration. Pass a Map of auth config fields to update.

update-postgrest-config

fn (request: UpdatePostgrestConfigRequest): Map

Update PostgREST configuration.

Types

ApiKey

ApiKey type {
    name: Str,
    api_key: Str
}

CreateProjectRequest

CreateProjectRequest type {
    name: Str,
    organization_id: Str,
    region: Str,
    plan: Str?,
    db_pass: Str?,
    kps_enabled: Bool?
}

Project

Project type {
    id: Str,
    name: Str?,
    organization_id: Str?,
    region: Str?,
    status: Str?,
    database: Map?,
    created_at: Str?
}

ProjectHealth

ProjectHealth type {
    name: Str,
    healthy: Bool,
    status: Str,
    info: Map?
}

UpdatePostgrestConfigRequest

UpdatePostgrestConfigRequest type {
    project_ref: Str,
    db_schema: Str?,
    max_rows: Int?,
    db_extra_search_path: Str?,
    db_pool: Int?
}