# GateContext

`type` in `gateway` · v0.1.0-next.3

<https://docs.seedcord.org/packages/gateway/0.1.0-next.3/types/gate-context>

What a gateway gate's check receives, tagged by `ctx.kind`. Narrow on `kind` before reading `interaction` or `payload`.

## Examples

```ts
// a gate that handles either arm narrows on ctx.kind
const Either = defineGate('either', (ctx: GateContext) => {
    if (ctx.kind === 'interaction') void ctx.interaction;
    else void ctx.payload;
});
```

## Declaration

```ts
type GateContext = InteractionGateContext | EventGateContext;
```

## See also

- [InteractionGateContext](/packages/gateway/0.1.0-next.3/interfaces/interaction-gate-context)
- [EventGateContext](/packages/gateway/0.1.0-next.3/interfaces/event-gate-context)
