Use @convertmax/js when you want to install Convertmax through your application bundle instead of the site script snippet.

Install the package

npm install @convertmax/js

Browser usage

Create a client and point it at the Convertmax event endpoint:

import { createConvertmax } from "@convertmax/js";

const convertmax = createConvertmax({
  host: "https://event.convertmax.io",
  apiKey: "YOUR_API_KEY"
});

await convertmax.page("Pricing");

await convertmax.track("click", {
  target: "hero_cta",
  page: "https://example.com/pricing"
});

Node.js usage

Use the same package for backend or server-side tracking with runtime: "node":

import { createConvertmax } from "@convertmax/js";

const convertmax = createConvertmax({
  host: "https://event.convertmax.io",
  apiKey: process.env.CONVERTMAX_API_KEY,
  runtime: "node"
});

await convertmax.track("convert", {
  event_name: "order_checkout_completed",
  source: "api",
  revenue: 149.99
});

If your Node.js runtime does not expose fetch, pass one with the fetch option.

Send baseline events

After setup, track at least a page view and one conversion path event:

await convertmax.track("page_view", {});

Verify the install

After loading your app or sending a server event:

  1. confirm the SDK initializes successfully
  2. confirm a page_view event is emitted
  3. trigger one tracked event such as click, add_cart, or convert
  4. confirm requests are sent to https://event.convertmax.io

Use the Convertmax Chrome Extension to inspect runtime signals and captured requests in browser environments.