# `plandalf.addGate()`

Register a named access gate.

Implemented by the [browser object](https://github.com/plandalf/numi/blob/fc6f42b5ade3d63b71623934838a6509f17203e2/packages/sdk/src/browser.ts#L443); parameter and return types follow the [delegated class declaration](https://github.com/plandalf/numi/blob/fc6f42b5ade3d63b71623934838a6509f17203e2/packages/sdk/src/core/sdk.ts#L376).

Call this after `plandalf.ready()`. The browser wrapper can return `undefined` before initialization.

## Signature

```typescript
plandalf.addGate(
  name: string,
  flow: string,
  check?: GateCheck<any>,
): void
```

## Arguments

| Name | Type | Meaning |
| --- | --- | --- |
| `name` | `string` | Name used by `gate()`. |
| `flow` | `string` | Offer slug to show if access is missing. |
| `check?` | [`GateCheck`](https://plandalf.com/docs/packages/sdk/type-aliases/GateCheck)\<`any`\> | Optional access check. The browser wrapper declares this argument as `any` and passes it to the typed class method. |

## Example

```javascript title="addGate.js" lineNumbers lineNumberStart=1
plandalf.ready(() => {
  plandalf.addGate('export', 'upgrade', () => false)
})
```

## Returns

`void`

## Behaviour

The `check` callback can return a boolean or a promise. If omitted, the gate always presents its linked offer.

[All plandalf methods](https://plandalf.com/docs/sdk)

Source: https://plandalf.com/docs/sdk/addGate
