> ## Documentation Index
> Fetch the complete documentation index at: https://major-5cc5eebc-docs-bot-mr2qm9w6-typctx.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Lambda

> Invoke AWS Lambda functions from your apps.

The `LambdaResourceClient` allows you to invoke AWS Lambda functions directly from your application code.

## Usage

```typescript theme={null}
import { myLambdaClient } from "./clients";

const result = await myLambdaClient.invoke(
  "Invoke",
  {
    FunctionName: "my-function",
    Payload: JSON.stringify({ key: "value" }),
  },
  "call-lambda"
);

if (result.ok) {
  console.log(result.result.data);
}
```

## Inputs

The `invoke` method accepts the following arguments:

<ParamField path="command" type="string" required>
  The Lambda command to execute. Typically `"Invoke"`.
</ParamField>

<ParamField path="params" type="Record<string, unknown>" required>
  The parameters for the command, matching the AWS SDK input shape (e.g.,
  `FunctionName`, `Payload`).
</ParamField>

<ParamField path="invocationKey" type="string" required>
  A unique identifier for this operation.
</ParamField>

<ParamField path="timeoutMs" type="number">
  Optional timeout in milliseconds.
</ParamField>

## Outputs

On success (`ok: true`), the `result` object contains:

<ResponseField name="kind" type="&#x22;api&#x22;">
  Discriminator for the response type.
</ResponseField>

<ResponseField name="command" type="string">
  The command that was executed.
</ResponseField>

<ResponseField name="data" type="unknown">
  The response payload from the Lambda function.
</ResponseField>
