Search documentation

Search documentation

Customize your docs experience — choose your preferred framework for code examples:

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:

diff
- <PillarProvider productKey="your-product-key">
+ <PillarProvider agentSlug="your-agent-slug">

Environment variable:

diff
- NEXT_PUBLIC_PILLAR_PRODUCT_KEY=your-product-key
+ NEXT_PUBLIC_PILLAR_AGENT_SLUG=your-agent-slug
diff
- <PillarProvider productKey={process.env.NEXT_PUBLIC_PILLAR_PRODUCT_KEY!}>
+ <PillarProvider agentSlug={process.env.NEXT_PUBLIC_PILLAR_AGENT_SLUG!}>

CLI changes

diff
- 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:

diff
- 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.