# Gates
Use Plandalf gates to check access before showing a checkout, upgrade, or protected product action.
Source: /docs/sdk/gates
Last modified: 2026-06-18
Gates let you centralize "can this customer access this?" checks around a named action and fallback offer.

## Register a gate

```js
plandalf.addGate("export-csv", "upgrade-pro", async () => {
  const user = await getCurrentUser();
  return user.plan === "pro";
});
```

## Check a gate

```js
const { access } = await plandalf.gate("export-csv");

if (!access) {
  await plandalf.present("upgrade-pro");
}
```

## Use cases

- unlock a paid feature after purchase
- show an upgrade offer when a user reaches a limit
- check subscription state before a protected action
- reuse the same upgrade offer across multiple feature gates

## Identity

For account-specific gates, call `identify(jwt)` before evaluating the gate so the checkout and the access check refer to the same customer context.

## Related docs

- [Identify customers](/docs/sdk/identity)
- [React SDK](/docs/sdk/react)
- [Live events](/docs/sdk/events)