{"slug":"business/ENVIRONMENT_VARIABLES","title":"Shared Environment Variables","section":"business","sectionLabel":"Business","status":"unclassified","type":"document","path":"business/ENVIRONMENT_VARIABLES.mdx","bytes":7194,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\nAll shared environment variables for the Integratewise platform are configured in Vercel and automatically deployed across Production, Preview, and Development environments.\n\n## Configuration Management\n\nEnvironment variables are managed through:\n\n- **Vercel Project**: `integratewise-live-desktop` (prj_9qtr2VovM5PieoUaSGJX2CwzQMal)\n- **Team**: `spine-workspace-2a626284`\n- **Scope**: `team_KvVZddhjBYdibkqW29AY1JGp`\n\n## Public Application Configuration (NEXT*PUBLIC*\\*)\n\nThese variables are visible to the client and configure platform behavior:\n\n### Version & API Configuration\n\n| Variable                       | Value                                 | Purpose                              |\n| ------------------------------ | ------------------------------------- | ------------------------------------ |\n| `NEXT_PUBLIC_APP_VERSION`      | `1.0.0`                               | Application semantic version         |\n| `NEXT_PUBLIC_API_BASE_URL`     | `https://api.integratewise.ai`        | Base URL for API requests            |\n| `NEXT_PUBLIC_GATEWAY_ENDPOINT` | `https://api.integratewise.ai/api/v1` | Gateway service endpoint             |\n| `NEXT_PUBLIC_GATEWAY_TIMEOUT`  | `30000`                               | HTTP request timeout in milliseconds |\n| `NEXT_PUBLIC_GATEWAY_RETRIES`  | `3`                                   | Number of retry attempts on failure  |\n\n### Spine Network Configuration\n\n| Variable                       | Value                                       | Purpose                                                     |\n| ------------------------------ | ------------------------------------------- | ----------------------------------------------------------- |\n| `NEXT_PUBLIC_SPINE_ENDPOINT`   | `https://api.integratewise.ai/api/v1/spine` | Spine network service endpoint                              |\n| `NEXT_PUBLIC_SPINE_PROVIDER`   | `gateway-proxy`                             | Spine provider implementation (gateway-proxy, direct, etc.) |\n| `NEXT_PUBLIC_SPINE_NETWORK_ID` | `spn_0xA1B`                                 | Unique identifier for the Spine network                     |\n\n### Workspace & Tenant Configuration\n\n| Variable                      | Value              | Purpose                                        |\n| ----------------------------- | ------------------ | ---------------------------------------------- |\n| `NEXT_PUBLIC_WORKSPACE_ID`    | `ws_core`          | Primary workspace identifier                   |\n| `NEXT_PUBLIC_TENANT_ID`       | `iw-customer-zero` | Tenant/organization identifier                 |\n| `NEXT_PUBLIC_DEFAULT_PROFILE` | `operator`         | Default user profile for unauthenticated users |\n| `NEXT_PUBLIC_SESSION_TIMEOUT` | `3600000`          | Session timeout in milliseconds (1 hour)       |\n\n### Connector & Integration Configuration\n\n| Variable                         | Value                                                               | Purpose                                      |\n| -------------------------------- | ------------------------------------------------------------------- | -------------------------------------------- |\n| `NEXT_PUBLIC_ENABLED_CONNECTORS` | `salesforce,hubspot,github,linear,slack,notion,google-drive,stripe` | Comma-separated list of enabled integrations |\n| `NEXT_PUBLIC_NANGO_HOST`         | `https://api.nango.dev`                                             | Nango API platform for OAuth management      |\n\n### Feature Flags\n\n| Variable                          | Value  | Purpose                                          |\n| --------------------------------- | ------ | ------------------------------------------------ |\n| `NEXT_PUBLIC_FEATURE_WORKBENCH`   | `true` | Enable Workbench UI (connectors, MCP, execution) |\n| `NEXT_PUBLIC_FEATURE_MARKETPLACE` | `true` | Enable Marketplace for discovering integrations  |\n| `NEXT_PUBLIC_FEATURE_GOVERNANCE`  | `true` | Enable Governance policies and audit logs        |\n| `NEXT_PUBLIC_FEATURE_TWIN_AGENT`  | `true` | Enable Twin Agent for autonomous operations      |\n| `NEXT_PUBLIC_FEATURE_MCP`         | `true` | Enable Model Context Protocol support            |\n\n### Debugging & Observability\n\n| Variable                | Value   | Purpose                                       |\n| ----------------------- | ------- | --------------------------------------------- |\n| `NEXT_PUBLIC_LOG_LEVEL` | `info`  | Logging level (debug, info, warn, error)      |\n| `NEXT_PUBLIC_DEBUG`     | `false` | Enable debug mode (verbose logging, DevTools) |\n\n## Loading Environment Variables\n\nThe application uses the centralized `lib/env.ts` module:\n\n```typescript\n\nconst config = getConfig();\nconsole.log(config.api.baseUrl); // https://api.integratewise.ai\nconsole.log(config.features.workbench); // true\n```\n\n## Profile-Aware Configuration\n\nUser access is controlled by profile:\n\n| Profile      | Default Route  | Accessible Features                          |\n| ------------ | -------------- | -------------------------------------------- |\n| `operator`   | `/my-work`     | Workbench, connectors, MCP                   |\n| `integrator` | `/marketplace` | Marketplace, custom connectors, integrations |\n| `admin`      | `/admin`       | All features, governance, configuration      |\n| `analyst`    | `/analytics`   | Read-only analytics, reports                 |\n| `guest`      | `/`            | Public marketplace only                      |\n\n## Connector-Aware Routing\n\nThe `ConnectorConfigurationManager` filters connectors by:\n\n- **Enable/disable status** (via `NEXT_PUBLIC_ENABLED_CONNECTORS`)\n- **User profile** (profile must have connector access)\n- **Origin** (CRM, Engineering, Communication, Knowledge, Storage, Payments)\n- **Auth type** (OAuth 2.0, API Key)\n\n## Deployment\n\nAll variables are automatically:\n\n1. **Created in Vercel** via the `vercel env add` CLI\n2. **Available in `.env.development.local`** during local development\n3. **Injected at build time** into production bundles\n4. **Redeployed** when git push triggers Vercel build\n\n## Local Development\n\nTo pull variables locally:\n\n```bash\ncd apps/platform\nvercel env pull .env.development.local --scope team_KvVZddhjBYdibkqW29AY1JGp\n```\n\nTo update a variable in Vercel:\n\n```bash\nvercel env add NEXT_PUBLIC_LOG_LEVEL production,preview,development --value debug --scope team_KvVZddhjBYdibkqW29AY1JGp\n```\n\n## Adding New Variables\n\nWhen adding environment variables:\n\n1. **Update `.env.example`** with the new key and description\n2. **Add to `lib/env.ts`** in the appropriate configuration section\n3. **Create in Vercel**:\n   ```bash\n   vercel env add NEW_VAR_NAME --scope team_KvVZddhjBYdibkqW29AY1JGp\n   ```\n4. **Commit** both `.env.example` and `lib/env.ts` changes\n5. **Reference in code** via `getConfig()` helper\n\n## References\n\n- [Vercel Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables)\n- [`lib/env.ts`](../apps/platform/lib/env.ts) - Configuration schema\n- [`lib/connector-manager.ts`](../apps/platform/lib/connector-manager.ts) - Connector routing\n- [`.env.example`](../apps/platform/.env.example) - Variable documentation\n"}