.env.
At a glance
Before you start
Install the Stripe CLI and set up Stripe Projects in your application’s directory by following Stripe’s Projects docs.Provision a Stigg environment
.env.
What gets created
- A Stigg account, one per Stripe account. Running the command again from another project links the account you already have rather than creating a second one.
- Access for you. The account owner is the user matching the email address on your Stripe account, and whoever ran the CLI is added as a member. Sign in at app.stigg.io with that email to see everything the CLI created.
- A subscription to Stigg’s free Starter plan.
- A development environment, with a default product and its default API keys. To add a production environment, see environments — production environments are subject to your Stigg plan’s limits.
- Your local
.env, initialized with the environment’s details:
Environment credentials
These names hold while your project has one Stigg resource. With two or more, Stripe prefixes each resource’s variables with its resource name instead, and renames the existing resource’s variables when the second one is added. After
stripe projects add stigg/environment --name billing, the new resource’s server key is BILLING_SERVER_API_KEY, and one added earlier under the default name becomes STIGG_ENVIRONMENT_SERVER_API_KEY (its ID STIGG_ENVIRONMENT_ENVIRONMENT_ID). Check your .env after adding a resource, and update any code that reads the old names.Never ship
STIGG_SERVER_API_KEY in a client bundle, commit it, or log it.STIGG_SERVER_API_KEY with any of Stigg’s backend SDKs, the GraphQL API, or the REST API. For example, with the Node.js SDK:
Using the client key in the frontend
STIGG_CLIENT_API_KEY is the key for Stigg’s frontend SDKs: JavaScript, React, Vue.js, and Next.js.
Bundlers do not expose STIGG_CLIENT_API_KEY to frontend code under that name — reading process.env.STIGG_CLIENT_API_KEY there yields undefined. Copy the value into the public variable your framework requires: VITE_STIGG_CLIENT_API_KEY for Vite, REACT_APP_STIGG_CLIENT_API_KEY for Create React App, or NEXT_PUBLIC_STIGG_CLIENT_API_KEY for Next.js.
Before going to production, see hardening client-side access.
Managing the environment
Stripe Projects provisions Stigg on the free Starter plan only, so
stripe projects update, upgrade and downgrade do not apply. Linking an environment you already created in Stigg is not supported either — use stripe projects add to provision a new one, or manage existing environments in the dashboard.
Working with AI agents
Stigg publishes a guide that coding agents fetch automatically, covering the credentials and the first wiring of the server and client SDKs:--json and --yes:
Troubleshooting
The CLI reports an environment limit. Your Stigg account has reached the number of environments its plan allows. Remove an environment you no longer need, or upgrade your Stigg subscription.process.env.STIGG_CLIENT_API_KEY is undefined in the frontend. Expected — copy it into your framework’s public variable, as described above.
STIGG_SERVER_API_KEY is undefined after adding a second Stigg resource. Stripe renamed the variables to carry each resource’s name, as described in the credentials.
Related
Stripe billing integration
Connect Stigg to Stripe to bill your customers.
API keys
Key types, rotation, and where to find them.
Environments
Development and production environments in Stigg.
AI Terminal
Install the Stigg MCP server and agent skills in one command.