Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add recommendation on schema isolation (#45390)

Saxon Fletcher3ef1c1e08cd7
diff --git a/apps/docs/content/guides/api/securing-your-api.mdx b/apps/docs/content/guides/api/securing-your-api.mdx
index ba064520884..de875e9e599 100644
--- a/apps/docs/content/guides/api/securing-your-api.mdx
+++ b/apps/docs/content/guides/api/securing-your-api.mdx
@@ -68,6 +68,10 @@ alter default privileges for role postgres in schema public
revoke execute on functions from public;
```
+## Use a dedicated API schema
+
+If you want an extra boundary around your Data API, lock down the `public` schema and expose a dedicated schema, such as `api`, instead. You can control access with grants in any schema, but this can make the surface easier to reason about: objects in `api` represent your Data API, while internal tables and helper functions stay in schemas that are not exposed. See [Using Custom Schemas](/docs/guides/api/using-custom-schemas) for setup steps.
+
## Disable the Data API
If your app never uses Supabase client libraries, REST, or GraphQL data endpoints, turn the Data API off:
diff --git a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
index 8af67b6b776..46332736e5a 100644
--- a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
+++ b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
@@ -123,7 +123,7 @@ export const HardenAPIModal = ({ visible, onClose }: HardenAPIModalProps) => {
<DocsButton
abbrev={false}
className="w-min mt-4"
- href={`${DOCS_URL}/guides/database/hardening-data-api`}
+ href={`${DOCS_URL}/guides/api/using-custom-schemas`}
/>
</DialogSection>