Configuration

Two properties are enough: the project's address and its anon key. Everything else has a default. This page lists every spring.supabase.* key.

Why

The keys of a Supabase project decide what a caller may do, so where each one is written matters: the anon key is public, the service role key and the database password are not. The properties keep them in the configuration, where a server takes them from the environment, and the starter warns when a secret one ships in a Flutter app.

Example

# lib/resources/application.yml
spring:
  supabase:
    url: https://abcd.supabase.co
    anon-key: ${SUPABASE_ANON_KEY}
    service-role-key: ${SUPABASE_SERVICE_ROLE_KEY}   # a server only
    db:
      url: ${SUPABASE_DB_URL}                         # optional: SQL instead of the REST API
      rls: user
    auth:
      redirect-urls:
        - com.example.app://login
    cache:
      shared: [catalog]
# lib/resources/application.properties
spring.supabase.url=https://abcd.supabase.co
spring.supabase.anon-key=${SUPABASE_ANON_KEY}
spring.supabase.service-role-key=${SUPABASE_SERVICE_ROLE_KEY}
spring.supabase.db.url=${SUPABASE_DB_URL}
spring.supabase.db.rls=user
spring.supabase.auth.redirect-urls[0]=com.example.app://login
spring.supabase.cache.shared=catalog

The project

Key Type Default Meaning
spring.supabase.url String none The project's address: https://<ref>.supabase.co, or the local stack's http://127.0.0.1:54321. http or https, without a trailing slash, user, query or fragment; anything else fails the start. Every service is called under it (/rest/v1, /auth/v1, /storage/v1, /functions/v1, /realtime/v1), and a key or a token is only ever sent to it.
spring.supabase.anon-key String none The anon (publishable) key: sent as apikey with every call, and as the bearer token while nobody is signed in. It is meant to be public. A call without it fails with a StateError that names the property.
spring.supabase.service-role-key String none The service role (secret) key, used only inside asServiceRole. It passes row-level security: keep it on a server.
spring.supabase.connect-timeout Duration 10s How long the Realtime connection may take to open, unless the WebSocket client supabase-realtime (or default) sets its own connect-timeout. Realtime only: an HTTP call goes through the application's HttpTransport, whose own connect timeout applies, and timeout limits it as a whole.
spring.supabase.timeout Duration 30s How long a call may take, the answer's body included. The bodies of Storage downloads are not limited by it.

The database: spring.supabase.db

Key Type Default Meaning
spring.supabase.db.url String none The PostgreSQL address of the project (postgresql://postgres:<password>@db.<ref>.supabase.co:5432/postgres, or a pooler's). Set: the repositories use SQL over it. Not set: they use the project's REST API. See Data.
spring.supabase.db.rls off, user off As whom SQL runs. off: the user of db.url (usually postgres, who passes row-level security). user: the current user, with the role authenticated (or anon) and the token's claims.
spring.supabase.db.schema String the API's (public) The schema the REST API reads and writes (PostgREST's Accept-Profile and Content-Profile).
spring.supabase.db.max-rows int 1000 The most rows the REST API returns in one answer (the project's "Max rows"). An answer that long is read on in further calls, ordered by the id. Set it to the project's value when that one was changed.

Auth: spring.supabase.auth

Key Type Default Meaning
spring.supabase.auth.enabled bool true Whether the starter plugs Supabase Auth into Spring Security: on a server the resource server's defaults, and the supabaseAuth and supabaseAuthAdmin (on a server only) beans (sign-in).
spring.supabase.auth.redirect-urls List<String> empty The addresses a login through a provider, a magic link or a password reset may come back to. The first one is the default; any other redirectTo is refused before a request is made.
spring.supabase.auth.issuer String <url>/auth/v1 The issuer of the project's tokens (their iss).
spring.supabase.auth.jwt-secret String none The JWT secret of a project that still signs its tokens with HS256 (the legacy secret). Server only: with it tokens can be forged for any user.
spring.supabase.auth.persist-session bool true Whether the session is kept across restarts, in the application's SecretStore (in memory without one).
spring.supabase.auth.auto-refresh bool true Whether the access token is refreshed by a timer before it expires. Without it, it is refreshed when the next call needs it.
spring.supabase.auth.refresh-margin Duration 30s How long before its expiry an access token counts as expired.

Realtime, Storage, functions, caches

Key Type Default Meaning
spring.supabase.realtime.heartbeat-interval Duration 25s How often the Realtime connection says it is alive.
spring.supabase.realtime.timeout Duration 10s How long a join or a message waits for its answer.
spring.supabase.realtime.max-message-size DataSize 4MB The largest message read from Realtime (a change of a row can be 1 MB, a broadcast 3 MB); a larger one closes the connection.
spring.supabase.storage.signed-url-expiry Duration 1h How long a signed URL is valid when the call does not say.
spring.supabase.functions.region String none The region the Edge Functions run in (the x-region header); the nearest one when not set.
spring.supabase.functions.timeout Duration spring.supabase.timeout How long a function may take.
spring.supabase.cache.shared List<String> empty The caches whose entries are the same for every user. Every other cache keeps the entries of each caller apart. See Caches.

Settings of the other starters

Two parts of the starter are clients of other starters, and take their settings too:

Part Client name Keys Notes
Realtime supabase-realtime spring.websocket.client.config.supabase-realtime.*: reconnect.*, connect-timeout, max-text-message-size, phoenix.heartbeat-interval, phoenix.push-timeout, phoenix.vsn What is set there wins over spring.supabase.realtime.*. Its url is not read: the address is always the project's.
Edge Functions supabase-functions (or @EdgeFunctions(name:)) spring.feign.client.config.supabase-functions.* follow-redirects is not read: the client never follows a redirect.

See All properties of the WebSocket starter and of the Feign starter.

What the starter sets itself

The starter gives other starters defaults, as property sources of the lowest precedence: whatever the application sets itself wins.

When Default
spring.supabase.db.url is set spring.datasource.url=${spring.supabase.db.url}
spring.supabase.url is set, and neither spring.supabase.db.url nor spring.datasource.url spring.data.store=supabase
on a server, spring.supabase.url is set and auth.enabled is not false spring.security.oauth2.resourceserver.jwt.*, listed in Security on a server

Writing values

In Spring (Java)

Spring has no Supabase support: the keys are this project's own. The type is SupabaseProperties, a @ConfigurationProperties('spring.supabase') bean.

See also