Contents

API keys and tokens

The five kinds of credentials Nucleo uses, where to get each one, and how to keep them safe.

Pick the right credential

Nucleo does not have one API key for everything. Each API uses the credential that fits where the code runs and whose data it touches:

CredentialWhere it runsUsed bySafe in a browser?
Publishable keyShoppers' browsersCollectorYes — limited to your domains
Shopper tokenShoppers' browsersShipment TrackingYes — one parcel
Server tokenYour serversContent DeliveryNo
OAuth 2.0 access tokenAI assistants and apps acting for a personOAuth & OpenID Connect, MCP connector, AI ToolsOnly with PKCE
Webhook secretCarriers and tracking services calling NucleoTracking webhookNo

Publishable keys

Publishable keys identify your store, not a person. They are meant to live in your theme's code, so they never give read access to your data: what protects them is the list of domains they may be used from.

KeyFormatWhere to get itProtection
Collector keypk_ + 32 hex charactersSettings > Catalog > Search > InstallationsRequests must come from one of the installation's domains (Origin header)

The key can be rotated from the same page: the old value stops working at once, so update your theme in the same deploy.

Shopper tokens

Shoppers never get an account or a password from these APIs. They prove who they are with what they already have:

  • Tracking — every parcel has a signed tracking token, the last segment of its tracking link (…/track/{token}). It shows the parcel's progress and nothing else.

Server tokens

Server tokens read or change data. Keep them on your servers, in a secret store, and never ship them to a browser or a mobile app.

  • CMS delivery token (cmsdt_…) — reads the published content of one site. Create it in Nucleo under CMS > your site > Settings > For developers > Create token. The value is shown once. Send it as Authorization: Bearer cmsdt_….
curl https://api-brain.nucleoplatform.com/api/delivery/v1/acme/sites/12/menus \
  -H "Authorization: Bearer $NUCLEO_CMS_TOKEN"

OAuth 2.0 for apps and AI assistants

When software acts on behalf of a person — an AI assistant reading the catalog, an internal tool drafting a reply — it uses OAuth 2.0. The person signs in to Nucleo, sees a consent screen and approves; your client receives an access token that carries that person's permissions, in the active company (chosen with nucleo_switch_company), and nothing more.

  • Authorization server: https://auth.nucleoplatform.com (discovery at /.well-known/oauth-authorization-server and /.well-known/openid-configuration).
  • Flow: authorization code with PKCE (S256).
  • Clients register themselves with Dynamic Client Registration (RFC 7591) at /oauth/register: no need to ask us for a client id.
  • Tokens of self-registered clients carry the scope nucleo.ai_tools: they work on the MCP connector and the AI tools, on userinfo, on the AI company context (GET /api/mcp/context, PUT /api/mcp/company) and to revoke themselves, and nowhere else.

The AI assistants guide walks through the whole flow.

Webhook secrets

When a carrier or a tracking service pushes parcel events to Nucleo, each request is signed with the secret of the carrier connection it is addressed to: X-Nucleo-Signature is the lowercase hex HMAC-SHA256 of the exact raw body. See Webhooks.

When Nucleo calls your endpoint (the CMS revalidate call), it signs the request with the secret you configured: Nucleo-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of "t.body">. See Webhooks.

Keep credentials safe

  • Store server tokens and secrets in environment variables or a secret manager, never in a repository.
  • Give each integration its own credential, so you can rotate one without touching the others.
  • Rotate immediately if a server token may have leaked: rotation in Nucleo takes effect at once.
  • Restrict publishable keys to the domains you really use.
  • Treat any 401 you did not expect as a signal: the credential may have been rotated by someone in your team.