Client credentials are how you authenticate the SDK on a server, in a CI pipeline, or on a cloud platform, without an interactive login. You create them once locally, then make them available in your deployment environment (via environment variables, a secrets manager, or by passing them in directly) and the SDK picks them up automatically.Documentation Index
Fetch the complete documentation index at: https://docs.zapier.com/llms.txt
Use this file to discover all available pages before exploring further.
What are client credentials?
A client ID and client secret pair that let a headless script, app, CI job, or agent authenticate to Zapier without opening a browser. They act on behalf of the Zapier user who created them, so treat the secret like a password.Step 1: Create your credentials
Do this locally before you deploy. You need to be logged in viazapier-sdk login to create credentials.
Name them to reflect their purpose and environment. For example:
aws-lambda-sales-agent-prodgithub-actions-stagingvercel-preview
Via the CLI
Via the SDK
The SDK can also create credentials. This works because you are already logged in via the CLI locally, so the SDK uses that session to authenticate.Step 2: Store them in your deployment environment
The two variables your SDK will read:Railway
Railway
In your Railway project, open the Variables tab on your service and add both variables. For
client_secret, click the three-dot menu next to the variable and choose Seal so the value is delivered to builds and deployments but never visible in the UI or returnable via the API. Variable changes show up as staged changes that you deploy to apply.See Using Variables and Sealed variables.Vercel
Vercel
In your Vercel project, go to Settings > Environment Variables. Add both variables and scope them to the appropriate environments (Production, Preview, Development, or any Custom environment). For
client_secret, mark the variable as Sensitive so the value is non-readable from the dashboard or vercel env ls after creation. Changes only apply to new deployments, so redeploy after saving.See Environment variables and Sensitive environment variables.GitHub Actions
GitHub Actions
In your repository, go to Settings > Secrets and variables > Actions and select the Secrets tab. Click New repository secret and add each value. For better isolation between staging and production, you can also create environment secrets scoped to a deployment environment. Reference the secrets in your workflow file:See Using secrets in GitHub Actions.
GitLab CI/CD
GitLab CI/CD
In your project, go to Settings > CI/CD and expand the Variables section. Add both variables. Under Visibility, choose Masked to replace the value with
[MASKED] in job logs, or Masked and hidden for the strongest option, which also prevents the value from being revealed in the UI after creation. Optionally enable Protect variable to restrict the variables to pipelines on protected branches and tags only.See CI/CD variables and Mask a CI/CD variable.AWS (Lambda / ECS)
AWS (Lambda / ECS)
Store your credentials in AWS Secrets Manager or SSM Parameter Store (SecureString).For ECS, reference the secret ARNs in your task definition’s
secrets field. ECS injects the values as environment variables at runtime, and your code reads them via process.env.For Lambda, AWS recommends fetching the secret at runtime rather than storing it as a plaintext environment variable. Use the Parameters and Secrets Lambda Extension to retrieve and cache the secret across invocations, or call the AWS SDK directly (the secrets-manager example in Step 3 shows the SDK pattern).See Use Secrets Manager secrets in Lambda and ECS task definition secrets.Local development with isolated credentials
Local development with isolated credentials
For local development without running Add
zapier-sdk login, for example
when testing against staging credentials, create a .env file and load
it with a tool like dotenv:.env to your .gitignore.Step 3: Use your credentials
Once the environment variables are set, the SDK reads them automatically. No code changes are required.Loading credentials from a secrets manager
If your organization stores secrets in a vault like AWS Secrets Manager, HashiCorp Vault, or Doppler, you can fetch them at runtime and pass them in directly:Using the CLI in a deployed environment
The CLI also reads environment variables automatically:Security best practices
- Keep one credential pair per environment. Separate production, staging, and CI so you can rotate or revoke one without affecting the others.
- Never commit credentials to version control, even in private repositories.
- Use your platform’s native secret store (Railway Variables, Vercel Environment Variables, GitHub Secrets, GitLab CI Variables, AWS Secrets Manager) rather than plain text config files.
- If you think a secret has been exposed, delete it immediately to prevent unauthorized access to your Zapier account.
View your existing credentials
client_secret is never returned in list responses. It is only shown at creation time.
Rotate a credential
Rotate when a secret may have been exposed, or as part of routine key hygiene.- Create a new credential with a name that makes the environment clear.
- Update your deployment environment with the new credentials. Replace the values in your environment variables, secrets manager, or wherever you’re providing them.
- Redeploy and verify the SDK is working with the new credentials.
- Delete the old credential once the new one is confirmed working.
- Remove any references to the old client ID from your secret store.
Delete a credential
Delete a credential when you no longer need it, or if you think one may have been compromised.client_id is not left behind.
Troubleshooting
The SDK still asks me to log in
The SDK still asks me to log in
Make sure your credentials are available to the process where your code runs. If you’re using environment variables, check that both are set:
ZAPIER_CREDENTIALS_CLIENT_IDZAPIER_CREDENTIALS_CLIENT_SECRET
createZapierSdk({ credentials: { clientId, clientSecret } }), confirm the values are being fetched correctly before the SDK is initialized.On most platforms, environment variables only apply after a redeploy. If you recently added them, trigger a fresh deployment and try again.I'm getting 401 or authentication errors
I'm getting 401 or authentication errors
The credential may have been deleted. Run
npx zapier-sdk list-client-credentials locally (or the SDK equivalent) to confirm the client ID still exists. If it’s gone, create a new one and update your environment.I lost my client secret
I lost my client secret
The secret is only shown once at creation time. Delete the credential and create a new one, then update your deployment environment with the new values.
I accidentally committed a secret
I accidentally committed a secret
Delete the credential immediately. Any code using that client ID stops authenticating right away. Create a replacement, update your environment, then remove the secret from your repository history using
git filter-repo or your platform’s secret scanning remediation tools.How do I check which credentials are active in my account?
How do I check which credentials are active in my account?
Run
npx zapier-sdk list-client-credentials locally or call zapier.listClientCredentials() in the SDK. This returns all credentials with their client IDs and names, which is useful for confirming which ones exist and spotting any that should be deleted.Next steps
- API Reference: full SDK method documentation
- CLI Reference: all CLI commands including
create-client-credentials - Quickstart: getting started from scratch