Publisher keys
Create development and production keys, and where to put them in your app.
A publisher key identifies your organization on every serve request. It's a string that starts with spk_.
Create a key
- Open Integration under Publish on the Specify dashboard.
- Select New key, give it a name and turn on Development key.
- Copy the key and store it with your other configuration.
Development and production keys
Development keys are meant to be used when you're developing the integration and in dev environments. They work straight away, including while your organization is still pending approval. They return rotating sample ads and never touch your reporting. Always use a Development key everywhere except production.
Production keys serve real campaigns and earn revenue. This is what you should be using when your app is deployed in production. To create one your organization needs to be approved.
Where to put it
Publisher keys ship to the browser, so they are public by design.
However you should still read it from your environment rather than hardcoding it, so development and production builds pick up the right one.
SPECIFY_PUBLISHER_KEY=spk_1234567890abcdef1234567890abcdimport Specify from '@specify-sh/publisher-sdk';
export const specify = new Specify({
publisherKey: process.env.SPECIFY_PUBLISHER_KEY!
});Revoking a key
Select Revoke next to the key on the Integration page. Revocation is immediate: the next request using it is rejected with a 401, and any placement relying on it stops filling. Create the replacement and deploy it before revoking the old one.
Invalid keys
The SDK throws ValidationError at construction if a key is malformed. A key that is well formed but unknown or revoked fails at request time instead, and serve() will return null.