If you already know what npm, a terminal, and .env files are — feel free to skip this page and jump straight to the Quickstart.
What is a Terminal?
A terminal (also called a command line or shell) is a text-based interface where you control your computer by typing commands instead of clicking buttons. In this guide, you will use it to install the Analytiq SDK by running commands likenpm install analytiq.
How to open a terminal:
- Mac
- Windows
- VS Code
Press
Command + Space to open Spotlight Search, type Terminal, and press Enter.What is npm?
npm stands for Node Package Manager. It’s a tool that lets you add other people’s code (called “packages”) to your project. Think of it like an App Store, but for code. For example, when you type:What is yarn or pnpm?
yarn and pnpm are alternatives to npm — they do exactly the same thing, just slightly differently. You can use whichever one your project already uses.| Tool | Install command | Check if installed |
|---|---|---|
| npm | npm install | npm --version |
| yarn | yarn add | yarn --version |
| pnpm | pnpm add | pnpm --version |
What is an API Key?
An API key is like a unique password that identifies YOUR project when events are sent to Analytiq. When your app sendstrack('page_view'), the API key tells Analytiq: “This event belongs to this specific project.”
Your API key looks like this: pk_live_abc123def456ghi789...
You’ll get your API key from the Analytiq dashboard Settings page. We’ll show you exactly where in the next steps.
What is a .env File?
A.env file is a special file in your project folder where you store values that should not be hardcoded directly in your code (like your API key). Files starting with a . are hidden by default in most operating system file explorers (Finder on Mac, File Explorer on Windows) — but they are fully visible and editable in your code editor (like VS Code). Always use your code editor — not your file explorer — to create and edit .env files.
Example .env file:
The
.env file is listed in .gitignore — this means it never gets uploaded to GitHub. This keeps your API key safe even if your code is public.You don’t need to create a .env file to get started. You can paste your API key directly in code at first, then move it to a .env file later when you’re ready to deploy.
How does Analytiq work?
You don’t need to configure any server URLs or backend settings. Here’s the full picture:You’re Ready!
You now know everything you need. Let’s set up Analytiq in your project.Next: Quickstart
Finish setup in under 10 minutes