# alchemyGasManagerMiddleware | @account-kit/infra

> Overview of the alchemyGasManagerMiddleware function from @account-kit/infra

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function alchemyGasManagerMiddleware(
  policyId,
  policyToken?,
  webhookData?,
): Required<
  Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">
>;
```

Defined in: [account-kit/infra/src/middleware/gasManager.ts:92](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/infra/src/middleware/gasManager.ts#L92)

Paymaster middleware factory that uses Alchemy's Gas Manager for sponsoring
transactions. Adheres to the ERC-7677 standardized communication protocol.

## Example

```ts
import { sepolia, alchemyGasManagerMiddleware } from "@account-kit/infra";
import { http } from "viem";

const client = createSmartAccountClient({
  transport: http("rpc-url"),
  chain: sepolia,
  ...alchemyGasManagerMiddleware("policyId"),
});
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `policyId`
      </td>

      <td>
        `string` | `string`\[]
      </td>

      <td>
        The policyId (or list of policyIds) for Alchemy's gas manager
      </td>
    </tr>

    <tr>
      <td>
        `policyToken?`
      </td>

      <td>
        [`PolicyToken`](../type-aliases/PolicyToken)
      </td>

      <td>
        The policy token configuration
      </td>
    </tr>

    <tr>
      <td>
        `webhookData?`
      </td>

      <td>
        `string`
      </td>

      <td>
        The webhook data to include in the request
      </td>
    </tr>

  </tbody>
</table>

## Returns

`Required`\<`Pick`\<[`ClientMiddlewareConfig`](../../../../../aa-sdk/core/src/type-aliases/ClientMiddlewareConfig), `"dummyPaymasterAndData"` | `"paymasterAndData"`>>

Partial client middleware configuration containing `dummyPaymasterAndData` and `paymasterAndData`