> ## Documentation Index
> Fetch the complete documentation index at: https://developers.zite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Utilities

> Small zitejs helpers: in-app notifications, PDF generation, and file uploads.

## Notifications

Send in-app notifications from a backend [workflow](/framework/workflows) (`zitejs/notifications`, also
`zite.notifications` on the DB client):

```typescript theme={null}
import { ZiteNotifications } from 'zitejs/notifications';

await ZiteNotifications.create({
  recipients: ['user_abc'],                  // user ids
  title: 'New ticket assigned',
  body: 'Ticket #482 was assigned to you.',  // optional
  link: { path: '/tickets/482' },            // optional in-app destination
  idempotencyKey: 'ticket-482-assigned',     // optional; dedupes retries
});
```

Returns `{ created: number }`.

## PDF generation

Render HTML to a hosted PDF from a workflow (`zitejs/pdf`):

```typescript theme={null}
import { ZitePdf } from 'zitejs/pdf';

const { url } = await ZitePdf.renderHtml({ html, filename: 'invoice.pdf' });
```

`renderHtml({ html, filename? })` → `{ url, filename }`. Max 25 MB.

## File uploads

Upload a file and get back a hosted URL. Frontend hook:

```tsx theme={null}
import { useUpload } from 'zitejs/upload';

const { upload, isUploading } = useUpload();
const { url } = await upload(file);   // File | Blob | ArrayBuffer | string
```

Or `uploadFile({ data, filename })` → `{ fileUrl }` from anywhere. Store the URL in an
[attachments field](/api/field-types)'s `{ url, filename }` shape.
