Advertiser keys
Create development and production keys, and where to put them in your app.
An advertiser key connects the events you send to your Specify organization. It's a string that starts with sak_.
Create a key
- Open Integration under Advertise 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 for building and testing your integration. They work straight away, including while your organization is waiting for approval. Their events show in the event log on the Integration page for 7 days but never count towards your results, so test as much as you like.
Production keys record events and are what your live site uses. Owners and admins can create one once your organization is approved.
See your events
Events sent with a development key appear in the event log on the Integration page within a few seconds. For production keys, the page shows when your last event arrived and how many came in recently.
Where to put it
Advertiser keys ship to the browser, so they are public by design. The same key works in your server code.
Read it from your environment anyway, so development and production builds pick up the right one. For a Vite browser app:
VITE_SPECIFY_ADVERTISER_KEY=sak_your_key_hereimport Specify from '@specify-sh/advertiser-sdk';
export const specify = new Specify({
advertiserKey: import.meta.env.VITE_SPECIFY_ADVERTISER_KEY
});Replace sak_your_key_here with the key you copied. For Next.js or server code, follow the setup in those guides.
Revoking a key
Select Revoke next to the key on the Integration page. Only owners and admins can revoke a production key. Events sent with it are rejected from then on, so deploy its replacement first.
Invalid keys
With a malformed key, the browser client does nothing, and your server's capture() throws ValidationError. A well-formed key that is revoked or unknown is rejected when its events arrive. The HTTP API returns 401 for both.