# stateBridge

> **stateBridge**<`State`>(`key`): [`StateBridge`](/reference/knotkit/wire/interfaces/statebridge/)<`State`>

Defined in: [packages/wire/src/state-bridge.ts:59](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/wire/src/state-bridge.ts#L59)

Create the [StateBridge](/reference/knotkit/wire/interfaces/statebridge/) for one package, keyed by the string in its `Symbol.for` key.

A package owns exactly one bridge. Its key is part of no wire format: it identifies the attached state within a realm, and nothing persists it.

## Type Parameters

### State

`State`

## Parameters

### key

`string`

A `knotkit/<module>/<name>@<version>` key. The version suffix allows a later release to move its state shape without reading state attached by an older copy loaded beside it.

## Returns

[`StateBridge`](/reference/knotkit/wire/interfaces/statebridge/)<`State`>

## Throws

With `INVALID_ARGUMENT` when `key` does not match that shape.
