# Deployment

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

Zoom Rivet comes with built-in support to deploy to AWS Lambda. It provides a default `AwsLambdaReceiver` to parse and emit incoming webhook events.

Import `AwsLambdaReceiver` from the name spaced product you want to implement.

```javascript
import { AwsLambdaReceiver, ... } from "@zoom/rivet/chatbot";
```

When you instantiate a client class, pass a new instance of `AwsLambdaReceiver` to the `receiver` option.

```javascript
const chatbotClient = new ChatbotClient({
  // ...
  receiver: new AwsLambdaReceiver({
    webhooksSecretToken: "XXXXXXXXXXXXXXXXXXXXXX",
  });
  // ...
});
```

> `webhooksSecretToken` is a required option for `AwsLambdaReceiver`.

In your application's entry point, pass the Lambda handler to the `AwsLambdaReceiver`.

```javascript
export const handler = async (event, context, callback) => {
    const handler = await chatbotClient.start();
    return handler(event, context, callback);
};
```

## Local function testing

To test your AWS Lambda receiver without deploying to AWS for development or testing, we recommend using [Serverless Framework](https://www.serverless.com/), with the [Serverless Offline plugin](https://www.serverless.com/plugins/serverless-offline).

The following serverless.yml file configures the Serverless Framework to deploy a Lambda function to AWS. The function runs boot.js from the same directory when it receives an HTTP POST request to the `/zoom/events` endpoint.

```yaml
frameworkVersion: "4"

service: serverless-rivet-js

provider:
    name: aws
    runtime: nodejs20.x

functions:
    rivet:
        handler: boot.handler
        events:
            - http:
                  path: zoom/events
                  method: post

plugins:
    - serverless-offline
```

Test the function offline (locally) with the following command:

```shell
serverless offline --noPrependStageInUrl
```
