Docs Navigation
Official Documentation

PulseMetrics Documentation

Learn how to configure your organization, create telemetry projects, provision API keys, and track daily active users using the lightweight pulsemetrics-sdk client or universal REST endpoints.

01

Organization & Account Management

Team registration, authentication, settings, and session security

Registration & Onboarding

To start tracking daily active users, register an organization account on PulseMetrics.

Required Registration Fields:
  • Organization Name: e.g., Apex Innovations
  • Owner Full Name: First & Last name
  • Work Email: For verification & alerts
  • Mobile Phone: Verified administrative contact

Authentication & Login

Sign in to the PulseMetrics console using your registered organization email and password. Sessions are cryptographically authenticated with secure JWT tokens.

Session Security: Access tokens cycle automatically in the background. Active sessions are seamlessly preserved while you work inside the dashboard.

Profile & Company Settings

Manage your company profile attributes from Dashboard → Settings.

Editable Attributes:
  • Organization Name: Update the company display name across projects.
  • Owner First & Last Name: Update administrative identity.
  • Secondary Email: Optional backup for billing and operational notices.
  • Landline Number: Optional office phone contact.
Locked Attributes (Non-Editable):

Primary Email and Primary Phone Number are permanently tied to your registration to prevent unauthorized account takeovers.

Security & Password Recovery

Ensure continuous workspace security with automated password evaluation and OTP recovery.

Password Complexity

Enforces minimum 8 characters with upper, lower, digits, and symbols with live visual meter feedback.

6-Digit OTP Recovery

Single-click password recovery sends a time-limited 6-digit verification code to your verified email.

02

Project Management & API Keys

Partitioning applications, lifecycle states, and token security

Creating a New Project

PulseMetrics partitions telemetry by project. Create isolated projects for production, staging, internal tools, or individual applications.

1. Select project list

Navigate to Dashboard → Projects in the sidebar.

2. Configure details

Click + New Project, enter name and pick your dynamic timezone.

3. Provisioning

Click Create. An isolated ingestion pipeline and API Key are allocated instantly.

Project Settings & Status Lifecycle

Every project supports dynamic lifecycle state transitions to manage event ingestion without code deploys.

ACTIVE

Normal state. Ingestion engine actively buffers telemetry beacons and computes rolling DAU.

PAUSED

Ingestion pauses gracefully. Beacons are acknowledged without incrementing metrics.

ARCHIVED

Project becomes read-only. Historical analytics remain permanently accessible for audit.

Finding & Rotating API Keys

Authenticate telemetry payloads from the pulsemetrics-sdk with your Project API Key.

Locating Your Project API Key:
  1. Go to Dashboard → Projects and click your target project.
  2. Click Settings in the project navigation header.
  3. Under Project API key, view your secret key prefixed with DAU-.
  4. Click Copy key to copy it to your clipboard.
Environment Best Practice: Store your copied key in your application's environment file as NEXT_PUBLIC_DAU_KEY or DAU_API_KEY. Never commit production keys to public git repositories.

Active Sessions & Device Kill Switch

Navigate to Dashboard → Devices to inspect all browsers and computers currently authorized to access your organization.

Zero-Trust Device Controls:
  • Device Fingerprints: Inspect client platform (macOS, Windows, Linux) and last active timestamp.
  • Individual Session Revoke: Immediately terminate access on a suspicious workstation.
  • Global Kill Switch: Single-click revoke terminating all remote sessions worldwide.
03

JavaScript & Node.js SDK

Install pulsemetrics-sdk for automated session and daily user telemetry.

Install package
$npm install pulsemetrics-sdk
Initialize & dispatch telemetry
lib/dau.ts
// 1. Initialize tracker instance with your Project API Key
import Pulsemetrics from "pulsemetrics-sdk";

export const dau = new Pulsemetrics( 
  process.env.NEXT_PUBLIC_DAU_KEY || "YOUR_PROJECT_API_KEY"
);

// Method 1: init (Free & Starter plans)
await dau.init(user.id);

// Method 2: trackWithName (Pro and Enterprise plans)
await dau.trackWithName({
  userId: user.id,
  userName: user.name || "GUEST",
});

5 Production Lifecycle Patterns

Recommended hooks and architectural locations to dispatch telemetry:

Pattern 1: Right After Successful LoginAuth Trigger

Call dau.init or dau.trackWithName immediately when the user logs in via email/password or OAuth.

import { dau } from "@/lib/dau";

async function handleLogin(credentials) {
  const response = await api.post("/auth/login", credentials);
  const user = response.data.user;

  // Option 1: Free & Starter plans
  await dau.init(user.id);

  // Option 2: Pro and Enterprise plans
  await dau.trackWithName({
    userId: user.id,
    userName: user.name || "GUEST",
  });
}
Pattern 2: On Page Refresh / Session Restore (/api/me)SPA & Next.js Rehydration

When logged-in users refresh your SPA or Next.js app, trigger dau.init or dau.trackWithName right after restoring user state.

import { useEffect } from "react";
import { dau } from "@/lib/dau";

export function useSessionRestore() {
  useEffect(() => {
    async function fetchCurrentUser() {
      try {
        const response = await fetch("/api/me");
        if (response.ok) {
          const userData = await response.json();

          // Option 1: Free & Starter plans
          await dau.init(userData.id);

          // Option 2: Pro and Enterprise plans
          await dau.trackWithName({
            userId: userData.id,
            userName: userData.name || "GUEST",
          });
        }
      } catch (error) {
        console.error("Session restore error:", error);
      }
    }

    fetchCurrentUser();
  }, []);
}
Pattern 3: Auth Interceptor & Token RefreshHTTP Middleware

Trigger DAU tracking when an expired access token is refreshed in your Axios interceptor.

import axios from "axios";
import { dau } from "@/lib/dau";

axios.interceptors.response.use( 
  (response) => response,
  async (error) => {
    if (error.response?.status === 401) {
      // 1. Refresh expired token
      const newSession = await refreshAccessToken();

      // 2. Track DAU upon successful re-authentication
      if (newSession?.user?.id) {
        // Option 1: Free & Starter plans
        await dau.init(newSession.user.id);

        // Option 2: Pro and Enterprise plans
        await dau.trackWithName({
          userId: newSession.user.id,
          userName: newSession.user.name || "GUEST",
        });
      }

      // 3. Retry original request
      return axios(error.config);
    }
    return Promise.reject(error);
  }
);
Pattern 4: Centralized Inside Auth ContextGlobal Provider

Place dau.init or dau.trackWithName inside your global React AuthProvider so any authenticated user is tracked automatically.

import React, { createContext, useEffect, useState } from "react";
import { dau } from "@/lib/dau";

export const AuthContext = createContext(null);

export function AuthProvider({ children }) {
  const [user, setUser] = useState(null);

  useEffect(() => {
    if (user?.id) {
      // Option 1: Free & Starter plans
      dau.init(user.id).catch(console.error);

      // Option 2: Pro and Enterprise plans
      dau.trackWithName({
        userId: user.id,
        userName: user.name || "GUEST",
      }).catch(console.error);
    }
  }, [user?.id, user?.name]);

  return ( 
    <AuthContext.Provider value={{ user, setUser }}>
      {children}
    </AuthContext.Provider>
  );
}
Pattern 5: Anonymous Traffic & Public Sites (crypto.randomUUID)Public Sites & Blogs

For public websites, documentation, and blogs without authentication. Generates a persistent UUID stored in localStorage.

import { useEffect } from "react";
import { dau } from "@/lib/dau";

export function useAnonymousTracker() {
  useEffect(() => {
    // 1. Check or generate persistent anonymous ID
    let anonymousId = localStorage.getItem("dau_anon_id");

    if (!anonymousId) {
      anonymousId = crypto.randomUUID();
      localStorage.setItem("dau_anon_id", anonymousId);
    }

    // 2. Track DAU with anonymous UUID
    dau.init(anonymousId).catch(console.error);
  }, []);
}

SDK API Reference

new Pulsemetrics(apiKey: string)

Creates a new tracker instance. apiKey is the Project API Key obtained from your dashboard Project Settings.

tracker.init(userId: string): Promise<ApiResponse>
Free & Starter

Dispatches an asynchronous telemetry beacon associating the user identifier with the rolling 24-hour daily active user window.

tracker.trackWithName({ userId: string, userName: string }): Promise<ApiResponse>
Pro & Enterprise

Sends a telemetry record with both a unique user identifier and display name for user-level telemetry and identity retention.

HTTP REST API

Send telemetry beacons directly using cURL or any HTTP client from your backend service.

Required headers
  • Content-Type: application/json
  • x-api-key: YOUR_PROJECT_API_KEY
Payload structure
Endpoint 1: /trackFree & Starter
{ "user": "USER_ID" }
Endpoint 2: /track-with-namePro & Enterprise
{ "userId": "USER_ID", "userName": "John Doe" }

Use /track for user ID telemetry, or /track-with-name on Pro and Enterprise tiers to include user names.

curl -X POST "https://api.pulsemetrics.in/api/v1/dau/track" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_PROJECT_API_KEY" \
  -d '{"user": "USER_ID"}'
Automatic Deduplication: Multiple telemetry events for the exact same user identifier within a rolling 24-hour UTC window are deduplicated by the ingestion engine to ensure unskewed unique active metrics.

5-Minute Automated Data Refresh

Telemetry metrics refresh on an automated 5-minute interval across all analytics views. When events are tracked from your application, the latest active user numbers are updated and displayed every 5 minutes.

Background Auto-Refresh

If you keep the Analytics or Dashboard page open in your browser, your data automatically refreshes in the background every 5 minutes.

Zero Manual Reloads

You do not need to manually reload or refresh your browser tab. Updated telemetry data appears automatically as each 5-minute interval completes.