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

# Stripe Projects

> Provision a Stigg account, environment, and API keys from your terminal with the Stripe CLI.

[Stripe Projects](https://projects.dev/) is a plugin for the Stripe CLI that provisions third-party services on your behalf and hands back real credentials. Stigg is one of those services: a single command creates a Stigg account, provisions an environment, and writes the API keys straight into your local `.env`.

```bash theme={null}
stripe projects add stigg/environment
```

No signup form, no copying keys out of a dashboard — which also means a coding agent can set Stigg up without handing control back to you.

<Tip>
  Want Stigg to bill your customers through Stripe? Once your environment is provisioned, connect it to your Stripe account with the [Stripe billing integration](/documentation/native-integrations/billing/stripe/overview).
</Tip>

## At a glance

| | |
| - | - |
| Service reference | `stigg/environment` |
| Price | Free |
| Scope | Project - one Stigg environment per resource |
| What you get back | A Stigg account, an environment, and four environment variables |

***

## Before you start

Install the [Stripe CLI](https://docs.stripe.com/cli/install) and set up Stripe Projects in your application's directory by following [Stripe's Projects docs](https://docs.stripe.com/projects).

## Provision a Stigg environment

```bash theme={null}
stripe projects add stigg/environment
```

Stripe calls Stigg, provisions the environment, encrypts the returned credentials into its Secret Store, and syncs them to your `.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](https://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](/documentation/managing-your-account/environments) — production environments are subject to your Stigg plan's limits.
* **Your local `.env`**, initialized with the environment's details:
  ```bash theme={null}
  STIGG_SERVER_API_KEY=server-...
  STIGG_CLIENT_API_KEY=client-...
  STIGG_ENVIRONMENT_ID=...
  STIGG_ENVIRONMENT_SLUG=...
  ```

## Environment credentials

| Variable | What it is |
| - | - |
| `STIGG_SERVER_API_KEY` | Full-access **secret** key. Backend only. |
| `STIGG_CLIENT_API_KEY` | Publishable read-only key, safe to ship in a frontend bundle. |
| `STIGG_ENVIRONMENT_ID` | The provisioned environment's ID. |
| `STIGG_ENVIRONMENT_SLUG` | Its slug, as it appears in the dashboard. |

<Note>
  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.
</Note>

These are ordinary Stigg API keys — see [API keys](/documentation/managing-your-account/environments/api-keys) for how they work. They do not expire; rotate them with the CLI rather than by hand.

<Danger>
  Never ship `STIGG_SERVER_API_KEY` in a client bundle, commit it, or log it.
</Danger>

Use `STIGG_SERVER_API_KEY` with any of Stigg's [backend SDKs](/api-and-sdks/integration/backend), the [GraphQL API](/api-and-sdks/api-reference/graphql/introduction), or the [REST API](/api-and-sdks/api-reference/rest/introduction). For example, with the Node.js SDK:

```bash theme={null}
npm install @stigg/node-server-sdk
```

```typescript theme={null}
import Stigg from '@stigg/node-server-sdk';

// Initialize once per process and reuse the instance.
const stiggClient = Stigg.initialize({ apiKey: process.env.STIGG_SERVER_API_KEY });
```

### Using the client key in the frontend

`STIGG_CLIENT_API_KEY` is the key for Stigg's frontend SDKs: [JavaScript](/api-and-sdks/integration/frontend/javascript), [React](/api-and-sdks/integration/frontend/react), [Vue.js](/api-and-sdks/integration/frontend/vuejs), and [Next.js](/api-and-sdks/integration/frontend/nextjs).

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](/api-and-sdks/integration/frontend/hardening-client-side-access).

## Managing the environment

| Command | What it does |
| - | - |
| `stripe projects rotate <resource>` | Issues new server and client API keys for the environment. The previous keys keep working for 15 minutes, so a running app survives the rotation. |
| `stripe projects remove <resource>` | Archives the Stigg environment. |
| `stripe projects open stigg` | Opens the environment in the Stigg dashboard. You still sign in normally — the link only decides where you land. |
| `stripe projects status` | Lists the resources in your project, including the Stigg 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:

```bash theme={null}
stripe projects llm-context
```

For non-interactive runs, combine `--json` and `--yes`:

```bash theme={null}
stripe projects add stigg/environment --json --yes
```

To give your coding agent live access to Stigg, set up the MCP server and agent skills with the [AI Terminal](/documentation/getting-started/get-started-with-ai).

## 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](#using-the-client-key-in-the-frontend).

**`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](#the-credentials).

## Related

<CardGroup cols={2}>
  <Card title="Stripe billing integration" icon="credit-card" href="/documentation/native-integrations/billing/stripe/overview">
    Connect Stigg to Stripe to bill your customers.
  </Card>

  <Card title="API keys" icon="key" href="/documentation/managing-your-account/environments/api-keys">
    Key types, rotation, and where to find them.
  </Card>

  <Card title="Environments" icon="layer-group" href="/documentation/managing-your-account/environments">
    Development and production environments in Stigg.
  </Card>

  <Card title="AI Terminal" icon="rocket" href="/api-and-sdks/ai-terminal">
    Install the Stigg MCP server and agent skills in one command.
  </Card>
</CardGroup>


## Related topics

- [Overview](/documentation/native-integrations/billing/stripe/overview.md)
- [Getting started in minutes](/documentation/getting-started/get-started-in-minutes.md)
- [Example project](/guides/quick-start-guides/example-project.md)
- [BigQuery](/documentation/importing-and-exporting-data/export/bigquery.md)
- [Stripe App Marketplace](/documentation/native-integrations/billing/stripe/stripe-app-marketplace.md)


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