> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# forward

> **forward**(`event`): `object`

Defined in: behavior.types.action.ts:116

Forwards an event to the next Behavior(s) in the current chain.

Use `forward` to pass an event to succeeding Behaviors without starting a
fresh lookup. This is useful for intercepting events, performing side
effects, and then letting the default handling continue.

**Key rule:** When forwarding to a different event type, only Behaviors that
were already in the remaining chain AND match the new type will run. This
means cross-type `forward` is mostly useful for falling through to default
Behaviors, not for triggering user-defined Behaviors of a different type.

To trigger all Behaviors for a different event type, use [raise](/api/behaviors/functions/raise/)
instead.

:::caution[Beta]
This API should not be used in production and may be trimmed from a public release.
:::

## Parameters

### event

[`SyntheticBehaviorEvent`](/api/behaviors/type-aliases/syntheticbehaviorevent/) | [`NativeBehaviorEvent`](/api/behaviors/type-aliases/nativebehaviorevent/) | [`CustomBehaviorEvent`](/api/behaviors/type-aliases/custombehaviorevent/)

## Returns

`object`

### event

> **event**: [`SyntheticBehaviorEvent`](/api/behaviors/type-aliases/syntheticbehaviorevent/) \| [`NativeBehaviorEvent`](/api/behaviors/type-aliases/nativebehaviorevent/) \| [`CustomBehaviorEvent`](/api/behaviors/type-aliases/custombehaviorevent/)

### type

> **type**: `"forward"`

## Example

```ts
// Intercept and forward same event type
defineBehavior({
  on: 'insert.text',
  actions: [({event}) => [effect(logEvent), forward(event)]],
})

// Forward to default handling of different event type
defineBehavior({
  on: 'clipboard.paste',
  actions: [
    ({event}) => {
      const text = event.originEvent.dataTransfer?.getData('text/plain')
      return text ? [forward({type: 'insert.text', text})] : []
    },
  ],
})
```