Using NPM / Yarn / PNPM (Recommended)
This is the recommended approach for any modern JavaScript application using a bundler (Vite, Next.js, Webpack, etc.).Import Paths
Analytiq exports two entry points depending on your framework:-
The React Hook: Used strictly once in your root component for automatic setup (React & Next.js only).
-
The Core SDK: Used for triggering events via
track()in React, or for manual setup and tracking in Vanilla JS and Vue.
Using a CDN (Vanilla HTML/JS)
If you aren’t using a bundler and just want to include Analytiq in a basic HTML file, you can load it directly from the unpkg CDN. Place this script tags in your<head>:
<script>, the SDK exposes a global analytiq object attached to the window.
Environment Compatibility
Analytiq handles SSR (Server-Side Rendering) gracefully. It works seamlessly with:- React (via
analytiq/reacthook) - Next.js App Router & Pages Router (via
analytiq/reacthook) - Vue & Nuxt (via core
analytiqlibrary) - Vanilla JS (via NPM or CDN)
React Native Support:
The current stable version of Analytiq relies on browser
localStorage and window objects. It is not currently compatible with React Native without polyfills. A dedicated React Native SDK is on our roadmap. Let us know if you need this!What’s Next?
Pick your framework for a step-by-step integration guide:React
Setup for React + Vite or Create React App
Next.js
Setup for Next.js App Router
Vue.js
Setup for Vue 3
Vanilla HTML
Setup for plain HTML websites
JavaScript (Plain JS)
Setup with plain JavaScript — no TypeScript
TypeScript
Setup with TypeScript support