> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workload Identity for Vercel

> Call the Dodo Payments API from Vercel functions with the Vercel OIDC token, with no API key in your project environment variables.

Vercel can give your functions an OIDC token for the project. Dodo Payments trusts this token through a `vercel` provider.

## Provider Settings

| Setting | Value |
| - | - |
| Provider type | `vercel` |
| Issuer | `https://oidc.vercel.com/<team_slug>` (team issuer mode) |
| Audience | Must be `https://live.dodopayments.com` or `https://test.dodopayments.com` |
| Replay protection | Not enforced. The audience and the claim pins replace it. |
| JWT lifetime | 1 hour or less. |

The team slug has lowercase letters, digits, and hyphens only.

## Required Claims

The mapping must pin both `owner_id` (the team id) and `project_id`. Add `environment` to limit the trust to one environment:

```json theme={null}
[
  { "claim": "owner_id", "value": "team_..." },
  { "claim": "project_id", "value": "prj_..." },
  { "claim": "environment", "value": "production" }
]
```

## Project Configuration

1. In the Vercel project, open **Settings → Security** and turn on **Secure backend access with OIDC federation**.
2. Select the **Team** issuer mode.
3. Add `DODO_PAYMENTS_IDENTITY_PROVIDER_ID` with the value `wip_...` to the project environment variables.

## Token Audience

The default `aud` claim of a Vercel OIDC token is `https://vercel.com/<team_slug>`. Dodo Payments does not accept this audience. The `vercel()` helper exchanges the Vercel token at `https://oidc.vercel.com/~token` for a token with the Dodo Payments audience. You do not have to do more steps.

> [!NOTE]
>
> This exchange is available from these SDK versions: TypeScript 2.59.0, Python 1.125.0, Go v1.125.0, Java 1.125.0, Kotlin 1.125.0, Ruby 2.37.0, PHP 6.34.0, C# 6.43.0, Rust 1.127.0, and the Terraform provider 0.3.2. An older version sends the token with the default Vercel audience, and the exchange fails.

## SDK Usage

```typescript TypeScript theme={null}
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  environment: 'live_mode',
  workloadIdentity: {
    identityProviderId: process.env.DODO_PAYMENTS_IDENTITY_PROVIDER_ID,
    provider: DodoPayments.workloadIdentity.vercel(),
  },
});
```

```python Python theme={null}
import os
from dodopayments import DodoPayments
from dodopayments.workload_identity import WorkloadIdentity, vercel

client = DodoPayments(
    environment="live_mode",
    workload_identity=WorkloadIdentity(
        identity_provider_id=os.environ["DODO_PAYMENTS_IDENTITY_PROVIDER_ID"],
        provider=vercel(),
    ),
)
```

```go Go theme={null}
client := dodopayments.NewClient(
	option.WithEnvironmentLiveMode(),
	option.WithWorkloadIdentity(option.WorkloadIdentity{
		IdentityProviderID: os.Getenv("DODO_PAYMENTS_IDENTITY_PROVIDER_ID"),
		Provider:           workloadidentity.Vercel(),
	}),
)
```

Refer to [SDK Usage](https://docs.dodopayments.com/developer-resources/workload-identity/sdk-usage.md) for the other languages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.