Migrating from productKey to agentSlug
The SDK's primary identifier has changed from productKey (the product's subdomain) to agentSlug (a unique identifier on the Agent model). This decouples the install key from the product and ties it to a specific agent deployment, enabling multi-agent products where web, email, and Slack channels each have their own configuration.
See Agents for more on how agents and products relate.
No breaking changes
productKey still works everywhere. The backfill migration assigned every existing web agent its product's subdomain as the slug, so existing installs continue to work without changes. We recommend updating when convenient, but there is no urgency.
SDK changes
Provider prop:
- <PillarProvider productKey="your-product-key">+ <PillarProvider agentSlug="your-agent-slug">
Environment variable:
- NEXT_PUBLIC_PILLAR_PRODUCT_KEY=your-product-key+ NEXT_PUBLIC_PILLAR_AGENT_SLUG=your-agent-slug
- <PillarProvider productKey={process.env.NEXT_PUBLIC_PILLAR_PRODUCT_KEY!}>+ <PillarProvider agentSlug={process.env.NEXT_PUBLIC_PILLAR_AGENT_SLUG!}>
CLI changes
- npx pillar-cli init --product-key your-product-key+ npx pillar-cli init --agent-slug your-agent-slug
The .env.local file generated by pillar init now uses NEXT_PUBLIC_PILLAR_AGENT_SLUG.
API header changes
If you make direct API calls to Pillar's backend, the tenant-scoping header has changed:
- x-customer-id: your-product-key+ x-agent-slug: your-agent-slug
The backend tries x-agent-slug first, then falls back to x-customer-id for backward compatibility.
Finding your agent slug
Open your product in the Pillar dashboard, go to agent settings, and copy the slug. For existing products, the web agent's slug matches your old product subdomain.