Quickstart
Tamari needs two kinds of data: what developers do before they sign up, and when they sign up and activate. Four steps send both. The setup checklist in your dashboard ticks each one when its data arrives.
1. Create a write key
In the dashboard, open Setup or Settings → Write keys and create a key. It is shown once. Store it on your server as TAMARI_WRITE_KEY.
The same key goes in the snippet, so anyone can read it in your page source. It can only send data, never read it. Revoke and replace it in Settings if it is abused.
2. Add the snippet
Paste this tag on every page of your docs, blog and marketing site:
<script src="https://usetamari.com/snippet.js" data-write-key="YOUR_WRITE_KEY" async></script>
When a visitor signs in to your product, link their earlier visits to their account:
// After your sign-in, so earlier anonymous visits count for this person
window.tamari.identify({ userId: user.id, email: user.email });More options, privacy behaviour and single-page apps: Browser snippet.
3. Send signups
Call this from your backend when someone creates an account:
curl https://usetamari.com/api/v1/track \
-H "Authorization: Bearer $TAMARI_WRITE_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "signed_up",
"user_id": "usr_123",
"email": "ada@example.com",
"heard_about": "Conference talk",
"message_id": "signup-usr_123"
}'Include an identifier the snippet or an integration also saw, such as the email address or the user ID passed to identify. That is how Tamari links the signup to the docs visits, stars and talks before it.
4. Send first API calls
Call this the first time a user's API key makes a successful request:
curl https://usetamari.com/api/v1/track \
-H "Authorization: Bearer $TAMARI_WRITE_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "first_api_call",
"user_id": "usr_123",
"message_id": "first-call-usr_123"
}'Send went_live the same way when they reach production. Each of these is recorded once per developer, so sending it on every request does no harm, but it wastes your rate limit.
Next
- Connect GitHub and Discord, and import event attendee lists: Integrations.
- Every endpoint, field and status code: HTTP API.
- How signups are credited, and what the match rate means: How attribution works.