Skip to main content
This guide is for developers using plain JavaScript (no TypeScript). If you use TypeScript, see the TypeScript guide instead.

Step 1 — Install the SDK

Open your terminal inside your project folder and run:
If your project uses require() instead of import, no extra configuration is needed — the package ships with both formats built in.

Step 2 — All 5 functions in plain JavaScript


Step 3 — Using CommonJS require() syntax

If your project uses the older require() syntax (common in plain Node.js backends or older JavaScript projects):

Step 4 — In a React project (plain JS, no TypeScript)


Step 5 — In a Vue 3 project (plain JS)


Step 6 — Verify it is working

  1. Run your app: npm run dev
  2. Open the browser console (F12, then Console tab)
  3. You should see:
  1. Go to your Analytiq Dashboard, click your project, click Events in the sidebar
  2. Your event should appear within 5–10 seconds

Instead of pasting your API key directly in code, store it in a .env file:
Then read it in your code:
Never commit your .env file to GitHub. Make sure .env is listed in your .gitignore file.