Track Software License Activations in PostHog
Clifford2 min read
posthoganalyticswebhooksactivationskeymint
Understanding how your customers activate — when, from where, on what devices — tells you which markets are growing and where churn is happening. Wire Keymint's activation webhooks to PostHog for license analytics alongside your product analytics.
How It Works
- A customer activates your software via
POST /key/activate - Keymint emits
device.activatedwebhook - Your handler verifies the signature, extracts event data
- Your handler calls
posthog.capture()with the activation event - Build dashboards in PostHog showing activation trends
Setup
Keymint: Dashboard → Developer → Webhooks → Create Endpoint. Subscribe to device.activated, device.deactivated, license.created, floating_session.checked_out.
PostHog: Get your project API key from Project Settings.
The Handler
typescript
const posthog = new PostHog(process.env.POSTHOG_PROJECT_API_KEY!, {
host: 'https://us.i.posthog.com',
});
const event = JSON.parse(payload);
switch (event.type) {
case 'device.activated':
posthog.capture({
distinctId: event.data?.activation?.hostId || 'unknown',
event: 'license_activated',
properties: {
product_id: event.data?.license?.productId,
host_id: event.data?.activation?.hostId,
device_tag: event.data?.activation?.deviceTag,
license_type: event.data?.license?.licenseType || 'node-locked',
activations: event.data?.license?.activations,
max_activations: event.data?.license?.maxActivations,
$set: { last_activation_date: event.created_at },
},
});
break;
case 'license.created':
posthog.capture({
distinctId: event.data?.license?.customerId || 'system',
event: 'license_created',
properties: {
product_id: event.data?.license?.productId,
license_type: event.data?.license?.licenseType || 'node-locked',
},
});
break;
}Dashboards Worth Building
- Activation trends:
license_activatedevents grouped by day — is your user base growing? - Churn signals: licenses created but never activated after 14 days
- Device breakdown: group activations by
device_tagfor OS distribution - Activation vs. deactivation ratio: net license growth
Going Further
- Use PostHog groups to analyze at the organization level by passing
organization_id - Join activation events with in-app feature usage events to see which licensed features drive retention
- Set up alerts when activation count drops below a threshold
Full webhook docs: keymint.dev/docs/topics/webhooks