Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docs-lint-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: e23c860111349d8bac17b78b1fe632afe84223f9
key: 2d535367b06fe62354035464cf8334929bafca85
- name: install linter
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev e23c860111349d8bac17b78b1fe632afe84223f9
run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev 2d535367b06fe62354035464cf8334929bafca85
- name: install reviewdog
uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0
with:
Expand All @@ -41,4 +41,4 @@ jobs:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
supa-mdx-lint apps/docs/content/guides/getting-started apps/docs/content/guides/ai --format rdf | reviewdog -f=rdjsonl -reporter=github-pr-review
supa-mdx-lint apps/docs/content/guides/getting-started apps/docs/content/guides/ai apps/docs/content/guides/auth --format rdf | tee >(cat) | reviewdog -f=rdjsonl -reporter=github-pr-review
25 changes: 25 additions & 0 deletions .github/workflows/self-host-tests-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Self-Host Tests Smoke

on:
pull_request:
branches: ['master']
paths:
- 'docker/**/*'

# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
docker/
- name: Run docker-compose up
# Ensure all services can be started and healthy with default config
run: cd docker && cp .env.example .env && docker compose up --wait
2 changes: 1 addition & 1 deletion apps/docs/content/guides/api/sql-to-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { data, error } = await supabase
.limit(20)
```

## Select statement with complex Boolean Logic clause
## Select statement with complex Boolean logic clause

Select all columns from a single table with a complex where clause: OR AND OR

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/auth-anonymous.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ response = supabase.auth.sign_in_anonymously()

Converting an anonymous user to a permanent user requires [linking an identity](/docs/guides/auth/auth-identity-linking#manual-linking-beta) to the user. This requires you to [enable manual linking](/dashboard/project/_/settings/auth) in your Supabase project.

### Link an Email / Phone identity
### Link an email / phone identity

<Tabs
scrollable
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/guides/auth/auth-email-passwordless.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const { error } = await supabase.auth.verifyOtp({ token_hash, type })

Email one-time passwords (OTP) are a form of passwordless login where users key in a six digit code sent to their email address to log in to their accounts.

### Enabling Email OTP
### Enabling email OTP

Email authentication methods, including Email OTPs, are enabled by default.

Expand All @@ -162,7 +162,7 @@ Modify the template to include the `{{ .Token }}` variable, for example:

By default, a user can only request an OTP once every <SharedData data="config">auth.rate_limits.otp.period</SharedData> and they expire after <SharedData data="config">auth.rate_limits.otp.validity</SharedData>. This is configurable via `Auth > Providers > Email > Email OTP Expiration`. An expiry duration of more than 86400 seconds (one day) is disallowed to guard against brute force attacks. The longer an OTP remains valid, the more time an attacker has to attempt brute force attacks. If the OTP is valid for several days, an attacker might have more opportunities to guess the correct OTP through repeated attempts.

### Signing in with Email OTP
### Signing in with email OTP

#### Step 1: Send the user an OTP code

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/auth-email-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The templating system provides the following variables for use:

On hosted Supabase projects, edit your email templates on the [Email Templates](/dashboard/project/_/auth/templates) page. On self-hosted projects or in local development, edit your [configuration files](/docs/guides/local-development/customizing-email-templates).

## Mobile Deep Linking
## Mobile deep linking

For mobile applications, you might need to link or redirect to a specific page within your app. See the [Mobile Deep Linking guide](/docs/guides/auth/native-mobile-deep-linking) to set this up.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/auth-helpers/auth-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Setting `showLinks` to `false` will hide the following links:
- Send a magic link email
- Forgot your password?

### Sign in and Sign up views
### Sign in and sign up views

Add `sign_in` or `sign_up` views with the `view` prop:

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/guides/auth/auth-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ A HTTP Hook is an endpoint which takes in a JSON event payload and returns a JSO
</TabPanel>
</Tabs>

## Security Model
## Security model

Sign the payload and grant permissions selectively in order to guard the integrity of the payload.

Expand Down Expand Up @@ -261,7 +261,7 @@ Note that payloads are sent uncompressed in order to accurately track Content Le

In the dashboard, navigate to [`Authentication > Hooks`](/dashboard/project/_/auth/hooks) and select the appropriate function type (SQL or HTTP) from the dropdown menu.

### Error Handling
### Error handling

You should return an error when facing a runtime error. Runtime errors are specific to your application and arise from specific business rules rather than programmer errors.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subtitle: 'Use a custom email provider to send authentication messages'

The Send Email Hook runs before an email is sent and allows for flexibility around email sending. You can use this hook to configure a back-up email provider or add internationalization to your emails.

## Email Sending Behavior
## Email sending behavior

Email sending depends on two settings: Email Provider and Auth Hook status.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/auth-mfa/phone.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function AuthMFA() {
the background automatically and finally call the `onSuccess` callback, which
will show the authenticated `App` component on screen.

### Security Configuration
### Security configuration

Each code is valid for up to 5 minutes, after which a new one can be sent. Successive codes remain valid until expiry. When possible choose the longest code length acceptable to your use case, at a minimum of 6. This can be configured in the [Authentication Settings](/dashboard/project/_/settings/auth).

Expand Down
16 changes: 10 additions & 6 deletions apps/docs/content/guides/auth/debugging/error-codes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description: 'Supabase Auth Error Codes'
subtitle: 'Learn about the Auth error codes and how to resolve them'
---

## Auth Error Codes
## Auth error codes

Supabase Auth can return various errors when using its API. This guide explains how to handle these errors effectively across different programming languages.

## Error Types
## Error types

Supabase Auth errors are generally categorized into two main types:

Expand Down Expand Up @@ -73,10 +73,12 @@ All instances and subclasses of a `AuthRestException` have a `errorCode` propert

</Tabs>

## HTTP Status Codes
## HTTP status codes

Below are the most common HTTP status codes you might encounter, along with their meanings in the context of Supabase Auth:

{/* supa-mdx-lint-disable Rule001HeadingCase */}

### [403 Forbidden](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403)

Sent out in rare situations where a certain Auth feature is not available for the user, and you as the developer are not checking a precondition whether that API is available for the user.
Expand All @@ -97,13 +99,15 @@ Indicate that the Auth server's service is degraded. Most often it points to iss

Sent out when a feature is not enabled on the Auth server, and you are trying to use an API which requires it.

The following table provides a comprehensive list of error codes you may encounter when working with Supabase Auth. Each error code is associated with a specific issue and includes a description to help you understand and resolve the problem efficiently.
{/* supa-mdx-lint-enable Rule001HeadingCase */}

## Auth Error Codes Table
## Auth error codes table

The following table provides a comprehensive list of error codes you may encounter when working with Supabase Auth. Each error code is associated with a specific issue and includes a description to help you understand and resolve the problem efficiently.

<AuthErrorCodesTable />

## Best Practices for Error Handling
## Best practices for error handling

- Always use `error.code` and `error.name` to identify errors, not string matching on error messages.
- Avoid relying solely on HTTP status codes, as they may change unexpectedly.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Many Auth methods involve a redirect to your app. For example:

With Deep Linking, you can configure this redirect to open a specific page. This is necessary if, for example, you need to display a form for password reset, or to manually exchange a token hash.

## Setting up Deep Linking
## Setting up deep linking

<Tabs
scrollable
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/phone-login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Phone OTP login can:

<CostWarning />

## Enabling Phone Login
## Enabling phone login

Enable phone authentication on the [Auth Providers page](/dashboard/project/_/auth/providers) for hosted Supabase projects.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/redirect-urls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ For mobile applications you can use deep linking URIs. For example, for your `SI

Read more about deep linking and find code examples for different frameworks [here](/docs/guides/auth/native-mobile-deep-linking).

## Error Handling
## Error handling

When authentication fails, the user will still be redirected to the redirect URL provided. However, the error details will be returned as query fragments in the URL. You can parse these query fragments and show a custom error message to the user. For example:

Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/guides/auth/server-side/advanced-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ To improve experience for your users, we recommend redirecting users to one spec

This is not necessary. Both the access token and refresh token are designed to be passed around to different components in your application. The browser-based side of your application needs access to the refresh token to properly maintain a browser session anyway.

{/* supa-mdx-lint-disable-next-line Rule001HeadingCase */}

### My server is getting invalid refresh token errors. What's going on?

It is likely that the refresh token sent from the browser to your server is stale. Make sure the `onAuthStateChange` listener callback is free of bugs and is registered relatively early in your application's lifetime
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/sessions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ When a user signs out, the sessions affected by the logout are removed from the

Note that sessions are not proactively terminated when their maximum lifetime (time-box) or inactivity timeout are reached. These sessions are cleaned up progressively 24 hours after reaching that status. This allows you to tweak the values or roll back changes without causing unintended user friction.

### Can I use HTTP-Only cookies to store the access and refresh tokens?
### Can I use HTTP-only cookies to store the access and refresh tokens?

This is possible, but only for apps that use the traditional server-only web app approach where all of the application logic is implemented on the server and it returns rendered HTML only.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/third-party/aws-cognito.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ user_pool_id = "<id>"
user_pool_region = "<region>"
```

## Use a Pre-Token Generation Trigger to assign the authenticated role
## Use a pre-token generation trigger to assign the authenticated role

Your Supabase project inspects the `role` claim present in all JWTs sent to it, to assign the correct Postgres role when using the Data API, Storage or Realtime authorization.

Expand Down
14 changes: 7 additions & 7 deletions apps/docs/content/guides/database/extensions/pg_net.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ begin
) as request_id;

-- Optionally Log row data or other data for inspection in Supabase Dashboard's Postgres Logs
-- (https://supabase.com/dashboard/project/_/logs/postgres-logs)
raise log 'Logging an entire row as JSON (%)', row_data_var;

-- return the row data to inspect
-- return row data to inspect
return row_data_var;

-- Handle exceptions here if needed
exception
when others then
Expand Down Expand Up @@ -315,7 +315,7 @@ Supabase supports reconfiguring pg_net starting from v0.12.0+. For the latest re

</Admonition>

The extension is configured to execute up to 200 requests per second reliably. The response messages are stored for only 6 hours to prevent needless buildup. The default behavior can be modified by rewriting config variables.
The extension is configured to reliably execute up to 200 requests per second. The response messages are stored for only 6 hours to prevent needless buildup. The default behavior can be modified by rewriting config variables.

### Get current settings

Expand All @@ -332,7 +332,7 @@ where "name" like 'pg_net%';
Change variables:

```sql
alter role "postgres" set pg_net.ttl to '24 hour';
alter role "postgres" set pg_net.ttl to '24 hours';
alter role "postgres" set pg_net.batch_size to 500;
```

Expand Down Expand Up @@ -416,7 +416,7 @@ with "selected_table_rows" as (
-- Converts all the rows into a JSONB array
jsonb_agg(to_jsonb(<table_name>.*)) as JSON_payload
from <table_name>
-- Generally good practice to LIMIT the max amount of rows
-- good practice to LIMIT the max amount of rows
)
select
net.http_post(
Expand All @@ -426,7 +426,7 @@ select
FROM "selected_table_rows";
```

More examples can be seen in the [Extension's GitHub page](https://github.com/supabase/pg_net/)
More examples can be seen on the [Extension's GitHub page](https://github.com/supabase/pg_net/)

## Limitations

Expand All @@ -435,7 +435,7 @@ More examples can be seen in the [Extension's GitHub page](https://github.com/su
- Can only make POST requests with JSON data. No other data formats are supported
- Intended to handle at most 200 requests per second. Increasing the rate can introduce instability
- Does not have support for PATCH/PUT requests
- Can only work with one database at a time in PostgreSQL. It defaults to the postgres database.
- Can only work with one database at a time. It defaults to the postgres database.

## Resources

Expand Down
45 changes: 45 additions & 0 deletions apps/docs/spec/cli_v1_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,22 @@ parameters:
- name: 'Inbucket documentation'
link: 'https://www.inbucket.org'

- id: 'inbucket.admin_email'
title: 'inbucket.admin_email'
tags: ['local']
required: false
default: '[email protected]'
description: |
Email used as the sender for emails sent from the application.

- id: 'inbucket.sender_name'
title: 'inbucket.sender_name'
tags: ['local']
required: false
default: 'Admin'
description: |
Display name used as the sender for emails sent from the application.

- id: 'storage.enabled'
title: 'storage.enabled'
tags: ['storage']
Expand Down Expand Up @@ -1096,6 +1112,35 @@ parameters:
- name: 'Auth Server configuration'
link: 'https://supabase.com/docs/reference/auth'

- id: 'edge_runtime.enabled'
title: 'edge_runtime.enabled'
tags: ['edge-functions']
required: false
default: 'true'
description: |
Enable the local Edge Runtime service for Edge Functions.
links: []

- id: 'edge_runtime.policy'
title: 'edge_runtime.policy'
tags: ['edge-functions']
required: false
default: '"oneshot"'
description: |
Configure the request handling policy for Edge Functions. Available options:
- `oneshot`: Recommended for development with hot reload support
- `per_worker`: Recommended for load testing scenarios
links: []

- id: 'edge_runtime.inspector_port'
title: 'edge_runtime.inspector_port'
tags: ['edge-functions']
required: false
default: '8083'
description: |
Port to attach the Chrome inspector for debugging Edge Functions.
links: []

- id: 'functions.function_name.enabled'
title: 'functions.<function_name>.enabled'
tags: ['edge-functions']
Expand Down
Loading
Loading