# Popups

> Popups: the popups and banners of the NoClick app your account's owner can turn off, and back on.

## Popups

```typescript
class Popups
```

Which of the NoClick app's popups and banners your account's owner sees: `popups` maps each one (`run_results`, the
outputs shown after a workflow runs; `invite_banner`, the nudge to share a workflow's live invite link;
`publish_banner`, the nudge to publish an interface) to whether it shows. One never turned off shows. They're what
Settings → Popups in the NoClick app shows, and a popup's own "Don't show again" turns it off too.

| Attribute | Type | Description |
| --- | --- | --- |
| `popups` | `Record<string, boolean>` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

### Popups.get

```typescript
static get(options?: { client?: NoClick }): Promise<Popups>
```

Read which of the app's popups your account's owner sees. Any of your account's own keys may, but one held to one
of your users, which rejects with `PermissionDenied`: they're the owner's.

    const { popups } = await Popups.get();
    console.log(popups.run_results); // true until it's turned off

Parameters:

- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: Every popup, each `True` (it shows) or `False` (it's off).

### Popups.update

```typescript
static update(
  popups: Record<string, boolean>,
  options?: { client?: NoClick },
): Promise<Popups>
```

Show (`true`) or stop showing (`false`) the app's popups to your account's owner, in one change; a popup you leave
out stays as it is. A popup the app doesn't have, or a value that isn't `true` or `false`, rejects with
`InvalidRequest` and changes nothing. Resolves to every popup, as it stands after the change.

    await Popups.update({ invite_banner: false });

Parameters:

- `popups` (`Record<string, boolean>`, required)
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: Every popup, as it stands after the change.
