diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 1106cc65477..28d0e5fe600 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -1314,9 +1314,13 @@ export const functions: NavMenuConstant = { url: undefined, items: [ { - name: 'Create an Edge Function', + name: 'Quickstart', url: '/guides/functions/quickstart', }, + { + name: 'Create an Edge Function Locally', + url: '/guides/functions/local-quickstart', + }, { name: 'Deploy to Production', url: '/guides/functions/deploy', @@ -1325,6 +1329,10 @@ export const functions: NavMenuConstant = { name: 'Setting up your editor', url: '/guides/functions/local-development', }, + { + name: 'Development tips', + url: '/guides/functions/development-tips', + }, ], }, { @@ -1380,6 +1388,10 @@ export const functions: NavMenuConstant = { name: 'Integrating with Log Drains', url: '/guides/platform/log-drains', }, + { + name: 'Using Deno 2', + url: '/guides/functions/deno2', + }, ], }, { diff --git a/apps/docs/content/guides/functions/deno2.mdx b/apps/docs/content/guides/functions/deno2.mdx new file mode 100644 index 00000000000..4d762ca1c12 --- /dev/null +++ b/apps/docs/content/guides/functions/deno2.mdx @@ -0,0 +1,103 @@ +--- +id: 'deno2' +title: 'Using Deno 2' +description: 'Everything you need to know about the Deno 2 runtime' +subtitle: 'Everything you need to know about the Deno 2 runtime' +--- + + + +This feature is in Public Alpha. [Submit a support ticket](https://supabase.help) if you have any issues. + + + +### What is Deno 2? + +Deno 2 is a major upgrade to the Deno runtime that powers Supabase Edge Functions. It focuses on scalability and seamless ecosystem compatibility while maintaining Deno's core principles of security, simplicity, and developer experience. + +**Key improvements include** + +- **Node.js and npm compatibility**: Dramatically improved support for npm packages and Node.js code +- **Better dependency management**: New tools like `deno install`, `deno add`, and `deno remove` for simplified package management +- **Improved performance**: Enhanced runtime execution and startup times +- **Workspace and monorepo support**: Better handling of complex project structures +- **Framework compatibility**: Support for Next.js, SvelteKit, Remix, and other popular frameworks +- **Full package.json support**: Works seamlessly with existing Node.js projects and npm workspaces + +While these improvements are exciting, they come with some changes that may affect your existing functions. We'll support Deno 1.x functions for a limited time, but we recommend migrating to Deno 2 within the next few months to ensure continued functionality. + +### How to use Deno 2 + +Deno 2 will soon become the default choice for creating new functions. For now, Deno 2 is available in preview mode for local development. + +Here's how you can build and deploy a function with Deno 2: + +- [Install Deno 2.1](https://docs.deno.com/runtime/getting_started/installation/) or newer version on your machine + +- Go to your Supabase project. `cd my-supabase-project` + +- Open `supabase/config.toml` and set `deno_version = 2` + +```toml +[edge_runtime] +deno_version = 2 +``` + +- All your existing functions should work as before. + +To scaffold a new function as a Deno 2 project: + +```bash +deno init --serve hello-world +``` + +- Open `supabase/config.toml` and add the following: + +``` +[functions.hello-world] +entrypoint = "./functions/hello-world/main.ts" +``` + +- Open supabase/functions/hello-world/main.ts and modify line 10 to: + +```typescript +if (url.pathname === "/hello-world") { +``` + +- Use `npx supabase@beta functions serve --no-verify-jwt` to start the dev server. + +- Visit http://localhost:54321/functions/v1/hello-world. + +- To run built-in tests, `cd supabase/functions/hello-world; deno test` + +### How to migrate existing functions from Deno 1 to Deno 2 + +For a comprehensive migration guide, see the [official Deno 1.x to 2.x migration guide](https://docs.deno.com/runtime/reference/migration_guide/#content). + +Most Deno 1 Edge Functions will be compatible out of the box with Deno 2, and no action needs to be taken. When we upgrade our hosted runtime, your functions will automatically be deployed on a Deno 2 cluster. + +However, for a small number of functions, this may break existing functionality. + +The most common issue to watch for is that some Deno 1 API calls are incompatible with Deno 2 runtime. + +For instance if you are using: + +- `Deno.Closer` + +Use [`Closer`](https://jsr.io/@std/io/doc/types/~/Closer) from the Standard Library instead. + +```tsx ++ import type { Closer } from "jsr:@std/io/types"; +- function foo(closer: Deno.Closer) { ++ function foo(closer: Closer) { + // ... +} +``` + +The best way to validate your APIs are up to date is to use the Deno lint, which has [rules to disallow deprecated APIs](https://docs.deno.com/lint/rules/no-deprecated-deno-api/). + + ```bash + deno lint + ``` + +For a full list of API changes, see the [official Deno 2 list](https://docs.deno.com/runtime/reference/migration_guide/#api-changes). diff --git a/apps/docs/content/guides/functions/development-tips.mdx b/apps/docs/content/guides/functions/development-tips.mdx new file mode 100644 index 00000000000..eb4e34841bf --- /dev/null +++ b/apps/docs/content/guides/functions/development-tips.mdx @@ -0,0 +1,114 @@ +--- +id: 'functions-development-tips' +title: 'Development tips' +description: 'Tips for getting started with Edge Functions.' +subtitle: 'Tips for getting started with Edge Functions.' +--- + +Here are a few recommendations when you first start developing Edge Functions. + +### Skipping authorization checks + +By default, Edge Functions require a valid JWT in the authorization header. If you want to use Edge Functions without Authorization checks (commonly used for Stripe webhooks), you can pass the `--no-verify-jwt` flag when serving your Edge Functions locally. + +```bash +supabase functions serve hello-world --no-verify-jwt +``` + +Be careful when using this flag, as it will allow anyone to invoke your Edge Function without a valid JWT. The Supabase client libraries automatically handle authorization. + +### Using HTTP methods + +Edge Functions support `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, and `OPTIONS`. A Function can be designed to perform different actions based on a request's HTTP method. See the [example on building a RESTful service](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/restful-tasks) to learn how to handle different HTTP methods in your Function. + + + +HTML content is not supported. `GET` requests that return `text/html` will be rewritten to `text/plain`. + + + +### Naming Edge Functions + +We recommend using hyphens to name functions because hyphens are the most URL-friendly of all the naming conventions (snake_case, camelCase, PascalCase). + +### Organizing your Edge Functions + +We recommend developing "fat functions". This means that you should develop few large functions, rather than many small functions. One common pattern when developing Functions is that you need to share code between two or more Functions. To do this, you can store any shared code in a folder prefixed with an underscore (`_`). We also recommend a separate folder for [Unit Tests](/docs/guides/functions/unit-test) including the name of the function followed by a `-test` suffix. +We recommend this folder structure: + +```bash +└── supabase + ├── functions + │ ├── import_map.json # A top-level import map to use across functions. + │ ├── _shared + │ │ ├── supabaseAdmin.ts # Supabase client with SERVICE_ROLE key. + │ │ └── supabaseClient.ts # Supabase client with ANON key. + │ │ └── cors.ts # Reusable CORS headers. + │ ├── function-one # Use hyphens to name functions. + │ │ └── index.ts + │ └── function-two + │ │ └── index.ts + │ └── tests + │ └── function-one-test.ts + │ └── function-two-test.ts + ├── migrations + └── config.toml +``` + +### Using config.toml + +Individual function configuration like [JWT verification](/docs/guides/cli/config#functions.function_name.verify_jwt) and [import map location](/docs/guides/cli/config#functions.function_name.import_map) can be set via the `config.toml` file. + +```toml supabase/config.toml +[functions.hello-world] +verify_jwt = false +import_map = './import_map.json' +``` + +### Not using TypeScript + +When you create a new Edge Function, it will use TypeScript by default. However, it is possible to write and deploy Edge Functions using pure JavaScript. + +Save your Function as a JavaScript file (e.g. `index.js`) and then update the `supabase/config.toml` as follows: + + + +`entrypoint` is available only in Supabase CLI version 1.215.0 or higher. + + + +```toml supabase/config.toml +[functions.hello-world] +# other entries +entrypoint = './functions/hello-world/index.js' # path must be relative to config.toml +``` + +You can use any `.ts`, `.js`, `.tsx`, `.jsx` or `.mjs` file as the `entrypoint` for a Function. + +### Error handling + +The `supabase-js` library provides several error types that you can use to handle errors that might occur when invoking Edge Functions: + +```js +import { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from '@supabase/supabase-js' + +const { data, error } = await supabase.functions.invoke('hello', { + headers: { 'my-custom-header': 'my-custom-header-value' }, + body: { foo: 'bar' }, +}) + +if (error instanceof FunctionsHttpError) { + const errorMessage = await error.context.json() + console.log('Function returned an error', errorMessage) +} else if (error instanceof FunctionsRelayError) { + console.log('Relay error:', error.message) +} else if (error instanceof FunctionsFetchError) { + console.log('Fetch error:', error.message) +} +``` + +### Database Functions vs Edge Functions + +For data-intensive operations we recommend using [Database Functions](/docs/guides/database/functions), which are executed within your database and can be called remotely using the [REST and GraphQL API](/docs/guides/api). + +For use-cases which require low-latency we recommend [Edge Functions](/docs/guides/functions), which are globally-distributed and can be written in TypeScript. diff --git a/apps/docs/content/guides/functions/local-quickstart.mdx b/apps/docs/content/guides/functions/local-quickstart.mdx new file mode 100644 index 00000000000..4afbc8a83d1 --- /dev/null +++ b/apps/docs/content/guides/functions/local-quickstart.mdx @@ -0,0 +1,125 @@ +--- +id: 'functions-local-quickstart' +title: 'Developing Edge Functions locally' +description: 'Get started with Edge Functions on your local machine.' +subtitle: 'Get started with Edge Functions on your local machine.' +tocVideo: '5OWH9c4u68M' +--- + +Let's create a basic Edge Function on your local machine and then invoke it using the Supabase CLI. + +## Initialize a project + +Create a new Supabase project in a folder on your local machine: + +```bash +supabase init +``` + + + +Check out the [CLI Docs](/docs/guides/cli) to learn how to install the Supabase CLI on your local machine. + + + + + +If you're using VS code you can have the CLI automatically create helpful Deno settings when running `supabase init`. Select `y` when prompted "Generate VS Code settings for Deno? [y/N]"! + + + + + +If you're using an IntelliJ IDEA editor such as WebStorm, you can use the `--with-intellij-settings` flag with `supabase init` to create an auto generated Deno config. + + + +## Create an Edge Function + +Let's create a new Edge Function called `hello-world` inside your project: + +```bash +supabase functions new hello-world +``` + +This creates a function stub in your `supabase` folder: + +```bash +└── supabase + ├── functions + │ └── hello-world + │ │ └── index.ts ## Your function code + └── config.toml +``` + +## How to write the code + +The generated function uses native [Deno.serve](https://docs.deno.com/runtime/manual/runtime/http_server_apis) to handle requests. It gives you access to `Request` and `Response` objects. + +Here's the generated Hello World Edge Function, that accepts a name in the `Request` and responds with a greeting: + +```tsx +Deno.serve(async (req) => { + const { name } = await req.json() + const data = { + message: `Hello ${name}!`, + } + + return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } }) +}) +``` + +## Running Edge Functions locally + +You can run your Edge Function locally using [`supabase functions serve`](/docs/reference/cli/usage#supabase-functions-serve): + +```bash +supabase start # start the supabase stack +supabase functions serve # start the Functions watcher +``` + +The `functions serve` command has hot-reloading capabilities. It will watch for any changes to your files and restart the Deno server. + +## Invoking Edge Functions locally + +While serving your local Edge Function, you can invoke it using curl or one of the client libraries. +To call the function from a browser you need to handle CORS requests. See [CORS](/docs/guides/functions/cors). + +<$CodeTabs> + +```bash name=cURL +curl --request POST 'http://localhost:54321/functions/v1/hello-world' \ + --header 'Authorization: Bearer SUPABASE_ANON_KEY' \ + --header 'Content-Type: application/json' \ + --data '{ "name":"Functions" }' +``` + +```js name=JavaScript +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY) + +const { data, error } = await supabase.functions.invoke('hello-world', { + body: { name: 'Functions' }, +}) +``` + + + + + +Run `supabase status` to see your local credentials. + + + +You should see the response `{ "message":"Hello Functions!" }`. + +If you execute the function with a different payload, the response will change. + +Modify the `--data '{"name":"Functions"}'` line to `--data '{"name":"World"}'` and try invoking the command again. + +## Next steps + +Check out the [Deploy to Production](/docs/guides/functions/deploy) guide to make your Edge Function available to the world. + +See the [development tips](/docs/guides/functions/development-tips) for best practices. diff --git a/apps/docs/content/guides/functions/quickstart.mdx b/apps/docs/content/guides/functions/quickstart.mdx index e4cf7af135a..8352713bdb4 100644 --- a/apps/docs/content/guides/functions/quickstart.mdx +++ b/apps/docs/content/guides/functions/quickstart.mdx @@ -1,20 +1,54 @@ --- id: 'functions-quickstart' -title: 'Developing Edge Functions locally' -description: 'Get started with Edge Functions on your local machine.' -subtitle: 'Get started with Edge Functions on your local machine.' -tocVideo: '5OWH9c4u68M' +title: 'Developing Edge Functions with Supabase' +description: 'Get started with Edge Functions on the Supabase dashboard.' +subtitle: 'Get started with Edge Functions on the Supabase dashboard.' --- -Let's create a basic Edge Function on your local machine and then invoke it using the Supabase CLI. +In this guide we'll cover how to create a basic Edge Function on the Supabase dashboard, and access it using the Supabase CLI. -## Initialize a project +## Deploy from Dashboard -Create a new Supabase project in a folder on your local machine: +Go to your project > Edge Functions > Deploy a new function > Via Editor -```bash -supabase init -``` +Deploy functions from the dashboard + +This will scaffold a new function for you. You can choose from Templates some of the pre-defined functions for common use cases. + +Scaffold functions through the dashboard editor + +Modify the function as needed, name it, and click `Deploy function` + +Your function is now active. Navigate to the function's details page, and click on the test button. + +You can test your function by providing the expected HTTP method, headers, query parameters, and request body. You can also change the authorization token passed (e.g., anon key or a user key). + +
+ Provide a request body to test your function +
+ +## Access deployed functions via Supabase CLI @@ -22,214 +56,113 @@ Check out the [CLI Docs](/docs/guides/cli) to learn how to install the Supabase - +Now that your function is deployed, you can access it from your local development environment. +Here's how: -If you're using VS code you can have the CLI automatically create helpful Deno settings when running `supabase init`. Select `y` when prompted "Generate VS Code settings for Deno? [y/N]"! +1. **Link your project** to your local environment. + + You can find your project reference ID in the URL of your Supabase dashboard or in the project settings. + + ```bash + supabase link --project-ref your-project-ref + ``` + +2. **List all Functions** in the linked Supabase project. + + ```bash + supabase functions list + ``` + +3. **Access the specific function** you want to work on. + + ```bash + supabase functions download function-name + ``` + +4. **Make local edits** to the function code as needed. + +5. **Run your function locally** before redeploying. + + ```bash + supabase functions serve function-name + ``` + +6. **Redeploy** when you're ready with your changes. + + ```bash + supabase functions deploy function-name + ``` + +{/* supa-mdx-lint-disable-next-line Rule001HeadingCase */} + +## Deploy via Assistant + +You can also leverage the Supabase Assistant to help you write and deploy edge functions. + +Go to your project > Edge Functions > Click on the Assistant icon to Create with Supabase Assistant + +Open Supabase Assistant + +This brings up an assistant window with a pre-filled prompt for generating edge functions. +Write up your Edge Function requirement, and let Supabase Assistant do the rest. + +
+ Generate a function with the assistant +
+ +Click Deploy and the Assistant will automatically deploy your function. + +This function requires an OpenAI API key. You can add the key in your Edge Functions secrets page, or ask Assistant for help. + +1. Navigate to your Edge Functions > Secrets page. +2. Look for the option to add environment variables. +3. Add a new environment variable with the key `OPENAI_API_KEY` and set its value to your actual OpenAI API key. + +Once you've set this environment variable, your edge functions will be able to access the OPENAI_API_KEY securely without hardcoding it into the function code. This is a best practice for keeping sensitive information safe. + +With your variable set, you can test by sending a request via the dashboard. Navigate to the function's details page, and click on the test button. Then provide a Request Body your function expects. + +
+ Provide a request body to test your function +
+ +## Editing functions from the Dashboard + + + +The Dashboard's Edge Function editor currently does not support versioning or rollbacks. We recommend using it only for quick testing and prototypes. When you’re ready to go to production, store Edge Functions code in a source code repository (e.g., git) and deploy it using one of the [CI integrations](https://supabase.com/docs/guides/functions/cicd-workflow). - +1. From the functions page, click on the function you want to edit. From the function page, click on the Code tab. -If you're using an IntelliJ IDEA editor such as WebStorm, you can use the `--with-intellij-settings` flag with `supabase init` to create an auto generated Deno config. +2. This opens up a code editor in the dashboard where you can see your deployed function's code. - - -## Create an Edge Function - -Let's create a new Edge Function called `hello-world` inside your project: - -```bash -supabase functions new hello-world -``` - -This creates a function stub in your `supabase` folder: - -```bash -└── supabase - ├── functions - │ └── hello-world - │ │ └── index.ts ## Your function code - └── config.toml -``` - -## How to write the code - -The generated function uses native [Deno.serve](https://docs.deno.com/runtime/manual/runtime/http_server_apis) to handle requests. It gives you access to `Request` and `Response` objects. - -Here's the generated Hello World Edge Function, that accepts a name in the `Request` and responds with a greeting: - -```tsx -Deno.serve(async (req) => { - const { name } = await req.json() - const data = { - message: `Hello ${name}!`, - } - - return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } }) -}) -``` - -## Running Edge Functions locally - -You can run your Edge Function locally using [`supabase functions serve`](/docs/reference/cli/usage#supabase-functions-serve): - -```bash -supabase start # start the supabase stack -supabase functions serve # start the Functions watcher -``` - -The `functions serve` command has hot-reloading capabilities. It will watch for any changes to your files and restart the Deno server. - -## Invoking Edge Functions locally - -While serving your local Edge Function, you can invoke it using curl or one of the client libraries. -To call the function from a browser you need to handle CORS requests. See [CORS](/docs/guides/functions/cors). - -<$CodeTabs> - -```bash name=cURL -curl --request POST 'http://localhost:54321/functions/v1/hello-world' \ - --header 'Authorization: Bearer SUPABASE_ANON_KEY' \ - --header 'Content-Type: application/json' \ - --data '{ "name":"Functions" }' -``` - -```js name=JavaScript -import { createClient } from '@supabase/supabase-js' - -const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY) - -const { data, error } = await supabase.functions.invoke('hello-world', { - body: { name: 'Functions' }, -}) -``` - - - - - -Run `supabase status` to see your local credentials. - - - -You should see the response `{ "message":"Hello Functions!" }`. - -If you execute the function with a different payload, the response will change. - -Modify the `--data '{"name":"Functions"}'` line to `--data '{"name":"World"}'` and try invoking the command again. +3. Modify the code as needed, then click Deploy updates. This will overwrite the existing deployment with the newly edited function code. ## Next steps -Check out the [Deploy to Production](/docs/guides/functions/deploy) guide to make your Edge Function available to the world. +Check out the [Local development](/docs/guides/functions/local-quickstart) guide for more details on working with Edge Functions. -Read on for some common development tips. - -## Development tips - -Here are a few recommendations when developing Edge Functions. - -### Skipping authorization checks - -By default, Edge Functions require a valid JWT in the authorization header. If you want to use Edge Functions without Authorization checks (commonly used for Stripe webhooks), you can pass the `--no-verify-jwt` flag when serving your Edge Functions locally. - -```bash -supabase functions serve hello-world --no-verify-jwt -``` - -Be careful when using this flag, as it will allow anyone to invoke your Edge Function without a valid JWT. The Supabase client libraries automatically handle authorization. - -### Using HTTP methods - -Edge Functions support `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, and `OPTIONS`. A Function can be designed to perform different actions based on a request's HTTP method. See the [example on building a RESTful service](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/restful-tasks) to learn how to handle different HTTP methods in your Function. - - - -HTML content is not supported. `GET` requests that return `text/html` will be rewritten to `text/plain`. - - - -### Naming Edge Functions - -We recommend using hyphens to name functions because hyphens are the most URL-friendly of all the naming conventions (snake_case, camelCase, PascalCase). - -### Organizing your Edge Functions - -We recommend developing “fat functions”. This means that you should develop few large functions, rather than many small functions. One common pattern when developing Functions is that you need to share code between two or more Functions. To do this, you can store any shared code in a folder prefixed with an underscore (`_`). We also recommend a separate folder for [Unit Tests](/docs/guides/functions/unit-test) including the name of the function followed by a `-test` suffix. -We recommend this folder structure: - -```bash -└── supabase - ├── functions - │ ├── import_map.json # A top-level import map to use across functions. - │ ├── _shared - │ │ ├── supabaseAdmin.ts # Supabase client with SERVICE_ROLE key. - │ │ └── supabaseClient.ts # Supabase client with ANON key. - │ │ └── cors.ts # Reusable CORS headers. - │ ├── function-one # Use hyphens to name functions. - │ │ └── index.ts - │ └── function-two - │ │ └── index.ts - │ └── tests - │ └── function-one-test.ts - │ └── function-two-test.ts - ├── migrations - └── config.toml -``` - -### Using config.toml - -Individual function configuration like [JWT verification](/docs/guides/cli/config#functions.function_name.verify_jwt) and [import map location](/docs/guides/cli/config#functions.function_name.import_map) can be set via the `config.toml` file. - -```toml supabase/config.toml -[functions.hello-world] -verify_jwt = false -import_map = './import_map.json' -``` - -### Not using TypeScript - -When you create a new Edge Function, it will use TypeScript by default. However, it is possible to write and deploy Edge Functions using pure JavaScript. - -Save your Function as a JavaScript file (e.g. `index.js`) and then update the `supabase/config.toml` as follows: - - - -`entrypoint` is available only in Supabase CLI version 1.215.0 or higher. - - - -```toml supabase/config.toml -[functions.hello-world] -# other entries -entrypoint = './functions/hello-world/index.js' # path must be relative to config.toml -``` - -You can use any `.ts`, `.js`, `.tsx`, `.jsx` or `.mjs` file as the `entrypoint` for a Function. - -### Error handling - -The `supabase-js` library provides several error types that you can use to handle errors that might occur when invoking Edge Functions: - -```js -import { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from '@supabase/supabase-js' - -const { data, error } = await supabase.functions.invoke('hello', { - headers: { 'my-custom-header': 'my-custom-header-value' }, - body: { foo: 'bar' }, -}) - -if (error instanceof FunctionsHttpError) { - const errorMessage = await error.context.json() - console.log('Function returned an error', errorMessage) -} else if (error instanceof FunctionsRelayError) { - console.log('Relay error:', error.message) -} else if (error instanceof FunctionsFetchError) { - console.log('Fetch error:', error.message) -} -``` - -### Database Functions vs Edge Functions - -For data-intensive operations we recommend using [Database Functions](/docs/guides/database/functions), which are executed within your database and can be called remotely using the [REST and GraphQL API](/docs/guides/api). - -For use-cases which require low-latency we recommend [Edge Functions](/docs/guides/functions), which are globally-distributed and can be written in TypeScript. +Read on for some [common development tips](/docs/guides/functions/development-tips). diff --git a/apps/docs/content/guides/self-hosting/docker.mdx b/apps/docs/content/guides/self-hosting/docker.mdx index 23f31ac0b70..b66ea247ceb 100644 --- a/apps/docs/content/guides/self-hosting/docker.mdx +++ b/apps/docs/content/guides/self-hosting/docker.mdx @@ -91,6 +91,7 @@ All of the services should have a status `running (healthy)`. If you see a statu Your app is now running with default credentials. [Secure your services](#securing-your-services) as soon as possible using the instructions below. +
### Accessing Supabase Studio @@ -211,7 +212,8 @@ basicauth_credentials: ``` To enable all dashboard features outside of `localhost`, update the following value in the `./docker/.env` file: - - `SUPABASE_PUBLIC_URL`: The URL or IP used to access the dashboard + +- `SUPABASE_PUBLIC_URL`: The URL or IP used to access the dashboard You will need to [restart](#restarting-all-services) the services for the changes to take effect. @@ -230,6 +232,7 @@ docker compose up -d {/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */} Be aware that this will result in downtime. Simply restarting the services does not apply configuration changes. + ## Stopping all services You can stop Supabase by running `docker compose stop` in same directory as your `docker-compose.yml` file. diff --git a/apps/docs/public/img/guides/functions/dashboard/assistant-description--light.png b/apps/docs/public/img/guides/functions/dashboard/assistant-description--light.png new file mode 100644 index 00000000000..3f11881b709 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/assistant-description--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/assistant-function-deploy--light.png b/apps/docs/public/img/guides/functions/dashboard/assistant-function-deploy--light.png new file mode 100644 index 00000000000..11769ee3c2b Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/assistant-function-deploy--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/assistant-function-gen--light.png b/apps/docs/public/img/guides/functions/dashboard/assistant-function-gen--light.png new file mode 100644 index 00000000000..f948d1bd2f0 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/assistant-function-gen--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/create-with-assistant--light.png b/apps/docs/public/img/guides/functions/dashboard/create-with-assistant--light.png new file mode 100644 index 00000000000..d6a9f872166 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/create-with-assistant--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/deploy-function--light.png b/apps/docs/public/img/guides/functions/dashboard/deploy-function--light.png new file mode 100644 index 00000000000..95783aa9979 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/deploy-function--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/function-keys--light.png b/apps/docs/public/img/guides/functions/dashboard/function-keys--light.png new file mode 100644 index 00000000000..aa04ecd5e43 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/function-keys--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/scaffold-function--light.png b/apps/docs/public/img/guides/functions/dashboard/scaffold-function--light.png new file mode 100644 index 00000000000..49365a9945b Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/scaffold-function--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/test--light.png b/apps/docs/public/img/guides/functions/dashboard/test--light.png new file mode 100644 index 00000000000..afe5d6fbdb9 Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/test--light.png differ diff --git a/apps/docs/public/img/guides/functions/dashboard/test-request-body--light.png b/apps/docs/public/img/guides/functions/dashboard/test-request-body--light.png new file mode 100644 index 00000000000..bc4a50bc7fa Binary files /dev/null and b/apps/docs/public/img/guides/functions/dashboard/test-request-body--light.png differ