[API reference](https://evolu.dev/docs/api-reference) › [@evolu/web](https://evolu.dev/docs/api-reference/web) › createMessageChannel

```ts
function createMessageChannel<Input, Output>(): MessageChannel<Input, Output>;
```

Defined in: [Worker.ts:81](https://github.com/evoluhq/evolu/blob/b6ade4b22d4be1758761a2712668e870d3e602c7/packages/web/src/Worker.ts#L81)

Creates a [MessageChannel](https://evolu.dev/docs/api-reference/common/Worker/interfaces/MessageChannel) from a Web MessageChannel.

### Example

```ts
const channel = createMessageChannel<Request, Response>();
channel.port1.onMessage = (response) => console.log(response);
channel.port1.postMessage({ type: "ping" });
```