# Push devices

> The push tokens of each user's devices (Expo, FCM, APNs or Web Push) with RLS, behind register_push_device and unregister_push_device for the user and push_tokens_for and prune_push_tokens for the service role. With notifications, push_tickets keeps Expo's tickets per delivery for the receipt check. better-supabase/blocks/push registers Expo devices and sends through the Expo Push API.

- Category: Notifications & messaging
- Module: `push`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/push
- Page: https://bettersupabase.com/blocks/push

## Install

```bash
npx better-supabase add push
```

## Configure

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

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

export default defineConfig({
  blocks: {
    // Modes: "managed", "custom". The default is "managed".
    push: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/push`.

## Events

- `push.device_registered`
- `push.device_unregistered`

## Related blocks

Works with: [notifications](https://bettersupabase.com/blocks/notifications.md)

## Recipes

- [Push opt-in](https://bettersupabase.com/recipes/push-opt-in.md): A card that registers this browser for web push and removes it again.
