Developer Portal

API Documentation

Everything you need to integrate EngagePro's powerful attribution engine into your web application.

Introduction

The @bluenath/engage SDK is a production-ready analytics module designed for EngagePro attribution and campaign intelligence. It captures web events, enriches intent signals, and sends batched payloads to our ingest servers for campaign-level ROI measurement.

NPM Package
npm install @bluenath/engage

Installation

Install the package via your preferred package manager:

npm install @bluenath/engage

Initialization

Wrap your application with the EngageProProvider at the root level.

import { EngageProProvider } from "@bluenath/engage";

// Initialize in your root component (e.g., main.tsx or App.tsx)
ReactDOM.createRoot(document.getElementById("root")!).render(
  <EngageProProvider
    apiKey="YOUR_PUBLIC_API_KEY"
    tracking={{
      autoTrack: true,
      useCookies: true,
      fingerprint: true,
    }}
  >
    <App />
  </EngageProProvider>,
);

Manual Tracking

Use the useAnalytics hook to track custom business events or conversions.

import { useAnalytics } from "@bluenath/engage";

export function CheckoutComplete() {
  const analytics = useAnalytics();

  const onPurchase = () => {
    analytics.track("PURCHASE", {
      orderId: "ORD-7281",
      amount: 2499,
      currency: "INR",
      ref: "camp_<campaignId>_cr_<creatorId>",
    });
  };

  return <button onClick={onPurchase}>Confirm Purchase</button>;
}
Pro Tip: For campaign-level attribution, always include the ref format: camp_<campaignId>_cr_<creatorId>.

Configuration

FieldTypeRequiredDescription
apiKeystringYesBrand public API key from EngagePro dashboard
apiHoststringNoLocal override ONLY for local development (localhost/127.0.0.1)
tracking.autoTrackbooleanYesEnable DOM interaction capture (clicks, forms, etc.)
tracking.useCookiesbooleanYesPersist anonymous identity across sessions
tracking.fingerprintbooleanYesInclude device fingerprint context for fraud prevention
debugbooleanNoLog payloads in console for integration testing

Endpoint Policy

To ensure data integrity and security, EngagePro enforces a strict endpoint policy:

  • The production ingest endpoint is fixed to our managed backend.
  • The apiHost override is ONLY accepted for local development (localhost or 127.0.0.1).
  • Unsupported hosts are automatically rejected and will fall back to the managed production endpoint.

Security & Best Practices

Important Security Notes:

  • Never use internal service keys or private keys in your frontend application.
  • If your public apiKey is leaked, rotate it immediately from the EngagePro dashboard.
  • Avoid sending raw Personally Identifiable Information (PII) inside custom properties. Use anonymous identifiers where possible.