diff --git a/apps/docs/content/_partials/quickstart_db_setup.mdx b/apps/docs/content/_partials/quickstart_db_setup.mdx index e639c4e05c8..08e577f4446 100644 --- a/apps/docs/content/_partials/quickstart_db_setup.mdx +++ b/apps/docs/content/_partials/quickstart_db_setup.mdx @@ -25,72 +25,33 @@ using (true);` ## 1. Create a Supabase project -Before you can use Supabase, you need a Supabase project. You can create a project visually in the Dashboard or programmatically using [the Management API](/docs/reference/api/introduction). - - - - +To start, you need a Supabase project. Create a new Supabase project from [the Dashboard of any organization](/dashboard/new/_) you belong to. - + -You can also use [database.new](https://database.new) to create a new Supabase project. +Use [the Management API](/docs/reference/api/v1-create-a-project) or ask [the MCP server](/docs/guides/ai-tools/mcp#account-management) to create a new Supabase project. - - - - -First, get your access token from the [**Account Settings > Access Tokens**](/dashboard/account/tokens) section of the Dashboard. - -Then create a project using [the Management API](/docs/reference/api/introduction): - -```bash -export SUPABASE_ACCESS_TOKEN="your-access-token" - -# List your organizations to get the organization ID -curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \ - https://api.supabase.com/v1/organizations - -# Create a new project (replace with your organization ID) -curl -X POST https://api.supabase.com/v1/projects \ - -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{ - "organization_id": "", - "name": "My Project", - "region": "us-east-1", - "db_pass": "" - }' -``` - - - - - -## 2. Install agent skills (optional) - -[Agent Skills](/docs/guides/ai-tools/ai-skills) are curated instruction sets that give your AI agent procedural knowledge about working with Supabase. - -Install them in your project with: - -```bash -npx skills add supabase/agent-skills -``` - -## 3. Set up your database +## 2. Set up your database When your Supabase project is up and running, create an `instruments` table with some sample data. Then set only the privileges each Postgres role needs, add [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security) for enhanced security for database data by default, and create an RLS policy to make the data in the table publicly readable. +Do these steps within your project's dashboard by copying and running the snippet in your project's [SQL Editor](/dashboard/project/_/sql/new). + Save some steps by clicking here to prefill the SQL in the SQL Editor, and then clicking **Run**. -Or do this manually in your project's [SQL Editor](/dashboard/project/_/sql/new), by pasting the SQL below, and clicking **Run**. + + +You can use [the Management API](/docs/reference/api/v1-run-a-query) or ask [the MCP server](/docs/guides/ai-tools/mcp#database) to execute SQL queries. + + ```sql SQL_EDITOR -- Create the table diff --git a/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx b/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx index 6b4665af590..392227c9fb6 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/astrojs.mdx @@ -6,7 +6,7 @@ breadcrumb: 'Framework Quickstarts' <$Partial path="quickstart_db_setup.mdx" /> -## 4. Create an Astro app +## 3. Create an Astro app Create an Astro app using the `npm create` command. @@ -15,6 +15,16 @@ npm create astro@latest my-app cd my-app ``` +## 4. Install Agent Skills (optional) + +Supabase's [Agent Skills](/docs/guides/ai-tools/ai-skills) is a curated set of instructions that give your AI agent procedural knowledge about working with Supabase. + +To install, run the following command in the root of your project: + +```bash +npx skills add supabase/agent-skills +``` + ## 5. Install Supabase client library and Node adapter Install the `supabase-js` client library and the `@astrojs/node` adapter to enable server-side rendering. @@ -39,11 +49,9 @@ export default defineConfig({ }) ``` -<$Partial path="api_settings.mdx" variables={{ "framework": "astro", "tab": "frameworks" }} /> - ## 7. Declare Supabase environment variables -Create a `.env.local` file and populate with your Supabase connection variables that you can get from the helper above, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=astro&tab=frameworks): +Create a `.env.local` file and populate with your Supabase connection variables that you can get from the helper below, or [from the project **Connect** panel](/dashboard/project/_?showConnect=true&framework=astro&tab=frameworks):