PulseFlow API Checklist

This documentation is designed to be extremely easy to follow, even if you have no technical background.

### 🚀 Getting Started in 3 Steps

1. **Get your API Key**: Go to your PulseFlow Dashboard and click on **Settings** > **API Keys**. Click 'Generate New Key'.
2. **Authorize this Page**: Copy your new key (it starts with `pf_`), scroll up to the top of this page, and click the green **Authorize** button. Paste your key in the box and click Authorize.
3. **Test it out!**: You can now click on any of the endpoints below (like `/api/v1/overview`), click **'Try it out'**, and then click **'Execute'** to see your live website data instantly!

---

### 📚 What can I do here?
Every single chart, graph, and number you see on your main dashboard is powered by these exact API routes.

You can use these endpoints to:
* **Build custom dashboards** in tools like Notion, Retool, or Google Looker Studio.
* **Trigger custom code** when a user makes a payment or hits a specific goal.
* **Export your raw data** into your own database for advanced analysis.

If you ever get stuck, just reach out!
Next.js Setup

PulseFlow for Next.js

Everything you need to ship world-class behavioral analytics in your React application. PulseFlow is designed to be lightweight, privacy-first, and ultra-accurate.

1

Installation (Next.js App Router)

Add the PulseFlow script to your root layout.tsx. Using next/script allows Next.js to optimize loading without blocking the main thread.

app/layout.tsx
import Script from 'next/script';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head>
        <Script
          src="https://api.pulseflow.app/script.js"
          data-api-key="YOUR_API_KEY_HERE"
          strategy="afterInteractive"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}
Tip: To bypass adblockers and improve data accuracy, check out the Next.js Proxy guide in the right sidebar.
2

TypeScript Support

Ensure type safety across your codebase by adding these global definitions. This prevents prop does not exist on window errors.

types/pulseflow.d.ts
interface PulseFlow {
  (action: 'event', name: string, options?: { 
    parameters?: Record<string, string | number | boolean>;
    revenue?: { amount: number; currency?: string };
  }): void;
  (action: 'identify', data: Record<string, unknown>): void;
}

interface Window {
  pulseflow?: PulseFlow;
}
3

No-Code Attribute Tracking

Track clicks or element visibility without writing JavaScript. PulseFlow scans for these attributes automatically.

Click Tracking
<button 
  data-fast-goal="upgrade_click"
  data-fast-goal-plan="enterprise"
>
  Upgrade Now
</button>
Visibility Tracking
<div 
  data-fast-scroll="view_pricing"
  data-fast-scroll-threshold="0.5"
>
  ...Pricing Table...
</div>