# Permissions

Each one is a sentence people read before they add your app — and a switch they can turn off later.

9 permissions · declared in manifest.json

## The nine

| Permission | What it gives you | People see |
| --- | --- | --- |
| `page.text` | Everything visible on the page, as text. | “Reads the text on this page” |
| `page.selection` | Only what the person highlights. | “Reads the text you select” |
| `page` | The live DOM — rewrite, restyle, animate, observe. | “Changes this page freely” |
| `storage` | Private JSON and files for this person and this app, on their account — anything they share by link, and stickers you give them. | “Remembers what you save” |
| `pub` | Values other people using this app can read back — and rooms they edit together, live. | “Saves values other people using this app can see” |
| `clipboard` | Paste what they copied — Fave1 asks them every time — and copy outside a tap. | “Copies and pastes — always asks before pasting” |
| `ai` | Ask an AI model or give your app a voice — runs on Fave1 AI, paid from their Fave1 credits, never yours. | “Uses AI — Fave1 AI, on your Fave1 credits” |
| `camera` | Live video from their camera while your app is open — Fave1 asks them first, shows a red dot, and keeps it on their page. | “Uses your camera — asks first, never saved by Fave1” |
| `mic` | Live sound from their microphone while your app is open — Fave1 asks them first, shows a red dot, and keeps it on their page. | “Uses your microphone — asks first, never saved by Fave1” |

Nine sentences open fourteen members of `ctx`. `storage` covers [ctx.storage](https://developers.fave1.com/docs/ctx-storage.md), [ctx.files](https://developers.fave1.com/docs/ctx-files.md), [ctx.shared](https://developers.fave1.com/docs/ctx-shared.md), [ctx.stickers](https://developers.fave1.com/docs/ctx-stickers.md) and [ctx.purchases](https://developers.fave1.com/docs/ctx-purchases.md) — the person’s own data, their files, what they share by link, the stickers you give them, and what they buy from you. `pub` covers [ctx.pub](https://developers.fave1.com/docs/ctx-pub.md) and [ctx.live](https://developers.fave1.com/docs/ctx-live.md) — what other people using your app can see, on a board or in a room. `ai` covers [ctx.ai](https://developers.fave1.com/docs/ctx-ai.md) — Fave1 AI on the person’s Fave1 credits, text and voice. `camera` covers [ctx.camera](https://developers.fave1.com/docs/ctx-camera.md) and `mic` covers [ctx.mic](https://developers.fave1.com/docs/ctx-mic.md) — two switches, so an app that shows a face can’t listen. One sentence, one switch, each. A permission that isn’t on this list fails the upload with its name. [ctx.notify](https://developers.fave1.com/docs/ctx-notify.md) isn’t on it because it has nothing to declare — Fave1 asks the person the first time your app sends a reminder, and its switch is in Settings › Notifications.

## When one is off

Every permission is a switch in Fave1 settings, per app. Flip one off and your app keeps opening — that part of `ctx` just stops answering. **Handling it is your job**, and review checks it: an app that crashes with one switch off gets sent back.

`src/index.ts`

```ts
if (!ctx.can('storage')) {
  // Signed out also reads as off — don't send them to a switch they can't see.
  ctx.ui.render(ctx.user.signedIn
    ? [
        ctx.ui.text('Saving is switched off for this app.'),
        ctx.ui.button('Open settings', { onClick: () => ctx.perms.open() }),
      ]
    : [ctx.ui.text('Sign in to Fave1 to save.')]);
  return;
}
```

| Off or undeclared | What your code sees | Check |
| --- | --- | --- |
| `page.text · page.selection · page` | The field is simply absent — `text` · `selection` · `document` are `undefined` | `ctx.can(…)` |
| `ai` | `chat()` · `stream()` · `run()` · `speak()` reject with `denied`, `ctx.ai.status()` says `off`, and `choices()` · `usage()` · `voices()` answer empty (no AIs · `null` · nothing ready). Its switch lives in Settings › AI with the monthly limit — the person may also have no Fave1 credits yet (`no-credits`) | `ctx.ai.status()` |
| `storage · pub · clipboard` | Every call rejects with a typed `denied` error — `ctx.files`, `ctx.shared`, `ctx.stickers`, `ctx.purchases` and `ctx.live.join()` included, since they ride on the same two switches. Storage keeps its data, files and shared links while off; pub clears its value, and no room can be joined. | `ctx.can(…)` |
| `camera · mic` | `open()` rejects with `denied`. Nothing turns on, and the browser never asks. | `ctx.can(…)` |

`ctx.perms.open()` opens their permission screen in a new tab — turning things on is always theirs to do, never yours.

## clipboard

With `clipboard` declared, `ctx.clipboard.read()` pastes — Fave1 asks the person every time — and `ctx.clipboard.write(text)` copies a line of text from anywhere in your app ([ctx.clipboard](https://developers.fave1.com/docs/ctx-clipboard.md)). If you only copy, you may not need it: a Copy button that calls `navigator.clipboard.writeText()` inside the tap works with no permission at all ([Beyond ctx](https://developers.fave1.com/docs/web-apis.md)) — and one less sentence on your store card.

## Ask for the narrowest one

Need the article body? `page.text`. Need what they highlighted? `page.selection`. Need to rewrite the DOM? `page`. Full power is one switch — and the store card says so out loud.

> **Less is faster.** A narrower ask reads better on the store card and goes through review sooner. Adding `page` or a new permission in an update gets a closer look.

> **Adding one in an update.** When the update is approved, everyone who already has your app gets the new permission — nobody is asked again. Anyone who switched a permission off in Settings keeps it off, so fold the new feature behind `ctx.can()`.
