Functions

anon-key

fn (): Str

Return the Supabase anon/public key from context.

Example

anon ::supabase::core/anon-key()
::supabase::api/request-with-keys("GET", "/rest/v1/users?select=id", {}, {}, anon, anon)
Context Vars: supabase.anon.key

project-url

fn (): Str

Return the Supabase project URL from context. Example: https://xxxx.supabase.co.

Example

url ::supabase::core/project-url()
`${url}/rest/v1/`
Context Vars: supabase.url

service-key

fn (): Str

Return the Supabase service role key from context. Required for admin operations.

Example

service ::supabase::core/service-key()
::supabase::api/request-with-keys("GET", "/rest/v1/users?select=id", {}, {}, service, service)
Context Vars: supabase.service.key

sources

fn (): Map

The live context and environment values, by sources-from.

Example

creds ::supabase::core/sources()
is-some(creds.service-key)
Context Vars: supabase.url, supabase.anon.key, supabase.api.key, supabase.service.key, supabase.service.role.key

sources-from

fn (values: Map): Map

The values every Supabase call starts from, without per-call options (pure), from values, a Map of context and environment variables by name. The precedence is:

  • URL: supabase.url, SUPABASE_URL
  • anon key: supabase.anon.key, supabase.api.key, SUPABASE_ANON_KEY, SUPABASE_API_KEY
  • service key: supabase.service.key, supabase.service.role.key, SUPABASE_SERVICE_KEY, SUPABASE_SERVICE_ROLE_KEY

Returns {url, anon-key, service-key}, each null when unset.

Example

::supabase::core/sources-from({"SUPABASE_URL": "https://x.supabase.co", "supabase.anon.key": "anon"})
// {url: "https://x.supabase.co", anon-key: "anon", service-key: null}