# Announcements

> In-app announcements for everyone, tenants, roles or plans within a time window, with per-user dismissals and a Realtime broadcast when they change. Staff manage them with announcements.manage on the platform.

- Category: Growth & engagement
- Module: `announcements`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/announcements
- Page: https://bettersupabase.com/blocks/announcements

## Install

```bash
npx better-supabase add announcements
```

The command also installs `updated-at`, `memberships`, `permissions`.

## Configure

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

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

export default defineConfig({
  blocks: {
    // Required by announcements; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    // Modes: "managed", "custom". The default is "managed".
    announcements: { mode: "managed" },
  },
});
```

## Client

The React hooks are the registry item `@better-supabase/use-announcements` (`npx shadcn add @better-supabase/use-announcements`). They return data and actions and render no UI. Source: https://github.com/ScaleDockHQ/better-supabase/blob/main/packages/registry/items/hooks/use-announcements.ts

## Events

- `announcement.archived`
- `announcement.created`
- `announcement.purged`
- `announcement.restored`
- `announcement.updated`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md)

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

## Recipes

- [Announcement banner](https://bettersupabase.com/recipes/announcement-banner.md): The newest live announcement for the user and organization, with a dismiss button.
