# StripeResource

- Module: [CommunityToolkit.Aspire.Hosting.Stripe](/reference/api/typescript/communitytoolkit.aspire.hosting.stripe.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

Represents a Stripe CLI container resource for local webhook forwarding and testing.

## Definition

```typescript
interface StripeResource
  extends IComputeResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport {
  webhookSigningSecret: string;
  withApiKey(apiKey: ParameterResource): StripeResource;
  withListen(
      forwardTo: IResourceWithEndpoints,
      webhookPath?: string,
      events?: string[]): StripeResource;
  withListenExternalService(
      forwardTo: ExternalServiceResource,
      webhookPath?: string,
      events?: string[]): StripeResource;
}
```

## Properties

- `webhookSigningSecret`: `string` `get - set` -- Gets the webhook signing secret retrieved from the Stripe CLI.

## Methods

- [withApiKey](/reference/api/typescript/communitytoolkit.aspire.hosting.stripe/striperesource/withapikey.md) -- `method` -- Configures the Stripe CLI to use a specific API key from a parameter.
    ```typescript
  withApiKey(apiKey: ParameterResource): StripeResource
  ```
- [withListen](/reference/api/typescript/communitytoolkit.aspire.hosting.stripe/striperesource/withlisten.md) -- `method` -- Configures the Stripe CLI to listen for webhooks and forward them to the specified URL expression.
    ```typescript
  withListen(forwardTo: IResourceWithEndpoints, webhookPath?: string, events?: string[]): StripeResource
  ```
- [withListenExternalService](/reference/api/typescript/communitytoolkit.aspire.hosting.stripe/striperesource/withlistenexternalservice.md) -- `method` -- Configures the Stripe CLI to listen for webhooks and forward them to the specified URL expression.
    ```typescript
  withListenExternalService(forwardTo: ExternalServiceResource, webhookPath?: string, events?: string[]): StripeResource
  ```
