Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Onshape V2 gets its own OAuth client
The sync integration (onshape) and the panel (onshape-v2) are separate Onshape apps. Today both read ONSHAPE_CLIENT_ID / ONSHAPE_CLIENT_SECRET; only the redirect URL differs. After this change they share no variable.
Variables
| Integration | Client id | Client secret | Redirect URL |
|---|---|---|---|
onshape (sync) |
ONSHAPE_CLIENT_ID |
ONSHAPE_CLIENT_SECRET |
ONSHAPE_OAUTH_REDIRECT_URL |
onshape-v2 (panel) |
ONSHAPE_V2_CLIENT_ID (new) |
ONSHAPE_V2_CLIENT_SECRET (new) |
ONSHAPE_V2_OAUTH_REDIRECT_URL |
onshape-government |
integration settings | integration settings (Vault) | derived from getAppUrl() |
- The sync integration keeps its names, so deployments that already set them are unchanged.
ONSHAPE_V2_CLIENT_IDis public (browser: true) likeONSHAPE_CLIENT_ID:config-v2.tsxis client-bundled and gates the card on it.ONSHAPE_DEV_CACHEstays one local-dev switch; it is not app configuration.
Steps
-
packages/env/src/schema.ts: new grouponshapeV2(feature label "Onshape V2");ONSHAPE_V2_CLIENT_ID(browser,needed),ONSHAPE_V2_CLIENT_SECRET(secret,needed); moveONSHAPE_V2_OAUTH_REDIRECT_URLinto it. Then the startup report does not call a deployment with one integration half-configured. -
packages/env/src/index.ts: export both; addONSHAPE_V2_CLIENT_IDtogetBrowserEnv(); fix the "same Onshape app" comment. -
apps/erp/app/root.tsx: addONSHAPE_V2_CLIENT_IDto the root loader'senv. -
packages/ee/src/onshape/lib/oauth.ts:getOnshapeOAuthConfigtakes client id, secret and redirect per integration id; unconfigured when any of the three is missing. -
packages/ee/src/onshape/config-v2.tsx:active: !!ONSHAPE_V2_CLIENT_ID. -
packages/ee/src/onshape/lib/oauth.test.ts: the panel uses its own client; each integration is unconfigured when only the other's variables are set. -
sst.config.ts: add the two variables to the ERP service. -
ci/src/deploy.ts:onshape_v2_client_id,onshape_v2_client_secretonWorkspace, the destructure and the ERP env. Theworkspacestable needs these columns (withonshape_v2_oauth_redirect_url); that table is outside this repo. - Docs:
docs/content/docs/integrations/cad.mdxsetup becomes two Onshape apps (sync: one redirect URI; panel: one redirect URI plus the Element right panel extension);docs/content/docs/platform/self-hosting/environment-variables.mdx. - Rules and guides:
.claude/rules/onshape-panel.md(OAuth bullet),.claude/rules/environment-configuration.md,packages/ee/AGENTS.md. The comment inpackages/ee/src/onshape/lib/connection.tsnames only the sync connections, so it stays as it is. - Verify:
@carbon/eeand@carbon/envtests, typecheckerpand@carbon/ee, Biome on changed files.
Not in this change
packages/env/src/vercel-production.jsonrecords what Vercel holds. Add the new names to it when someone adds them in Vercel.- The MES service in
sst.config.tsalready carries Onshape variables it does not use. This change does not touch them. - Token refresh still refuses without the redirect URL variable (
getOnshapeOAuthConfig); separate fix. - The Redis API-call counter
onshape:api-calls:<year>still counts every Onshape app together; separate fix.
Effect on existing connections
A connection's refresh token belongs to the app that issued it. A panel connection made with the shared client keeps working only if ONSHAPE_V2_CLIENT_* hold that same client; otherwise it must reconnect. Production has no panel connections yet.