# WebSocketRouteIntegration

The interface that various route integration classes will inherit.

Extends: WebSocketRouteIntegration
Superclass of: WebSocketAwsIntegration, WebSocketLambdaIntegration, WebSocketMockIntegration

- Source: [`aws-apigatewayv2/lib/websocket/integration.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/integration.ts#L242)
- Type last changed: v2.112.0 · 1 Dec 2023

## Example

```ts
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
new apigwv2.WebSocketStage(this, 'mystage', {
  webSocketApi,
  stageName: 'dev',
  autoDeploy: true,
});

declare const messageHandler: lambda.Function;
webSocketApi.addRoute('sendMessage', {
  integration: new WebSocketLambdaIntegration('SendMessageIntegration', messageHandler),
});
```

## Initializer

```ts
new WebSocketRouteIntegration(id: string)
```

## Methods

- `bind(options: WebSocketRouteIntegrationBindOptions): WebSocketRouteIntegrationConfig` — Bind this integration to the route.
