# Data API grants

> Writes the complete Data API privileges of the tables and functions in the `expose` config for anon, authenticated and service_role, or derives table grants from the policies. A project with default privileges turned off grants new tables to no Data API role.

- Category: Identity & access
- Module: `data-api-grants`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/sql
- Page: https://bettersupabase.com/blocks/data-api-grants

## Install

```bash
npx better-supabase add data-api-grants
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    "data-api-grants": { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.
