Skip to content

1. Sign up

Go to wirelog.ai and sign in with GitHub. A default organization is created automatically.

2. Create a project

From the dashboard, create a new project. You get two API keys:

KeyPrefixUse
Public keypk_...Client-safe. Track events only.
Secret keysk_...Server-side only. Track + query + admin.

Copy both. The secret key is shown once.

3. Track your first event

Terminal window
$ curl -X POST https://api.wirelog.ai/track \
-H "X-API-Key: pk_YOUR_PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_type": "signup",
"user_id": "alice@acme.org",
"event_properties": {"plan": "pro", "source": "github"}
}'
{"accepted": 1}

event_type is the only required field. user_id, device_id, session_id, event_properties, and user_properties are optional. Batch multiple events with {"events": [...]}.

4. Query it back

Terminal window
$ curl -X POST https://api.wirelog.ai/query \
-H "X-API-Key: sk_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "* | last 1d | count by event_type", "format": "llm"}'
## * | last 1d | count by event_type
| event_type | count |
|------------|-------|
| signup | 1 |

The format field controls output: llm (Markdown, default), json, or csv. Queries require a secret key (sk_) or an access token with query scope.

5. Add the JS SDK (optional)

For browser tracking, drop a single script tag:

<script
src="https://cdn.wirelog.ai/public/wirelog.js"
data-key="pk_YOUR_PUBLIC_KEY"
data-host="https://api.wirelog.ai">
</script>

This auto-tracks page_view on load, manages device_id via localStorage, and handles session_id with a 30-minute inactivity timeout.

Track custom events and identify users in JS:

// Track a custom event
wl.track("button_click", { button: "upgrade", page: "/pricing" });
// Identify a logged-in user
wl.identify("alice@acme.org", { plan: "pro", company: "Acme" });

6. Set up identity

Bind a device to a known user so pre-login events get stitched to the same distinct_id:

Terminal window
$ curl -X POST https://api.wirelog.ai/identify \
-H "X-API-Key: pk_YOUR_PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "alice@acme.org",
"device_id": "dev_abc123",
"user_properties": {"email": "alice@acme.org", "plan": "pro"},
"user_property_ops": {
"$set": {"plan": "pro"},
"$set_once": {"signup_source": "github"},
"$add": {"login_count": 1}
}
}'
{"ok": true}

user_id is required. device_id creates the device-to-user mapping. user_property_ops supports $set, $set_once, $add, and $unset for incremental profile updates.

Next steps

  • Query language — pipe DSL reference with sources, stages, and operators
  • Agent setup — MCP server, Claude Code skills, and agent query patterns
  • SaaS metrics — funnel, retention, and segmentation recipes