Introducing Vantrex Analytics: sign-ins, sign-ups and live users
See who signs in, who signs up and who is online right now in your own app. Two keys, one package, and it works wherever your app is hosted.

Today we are adding Vantrex Analytics to Vantrex. It shows you what happens inside your own app: who signs in, who signs up, which buttons get clicked and who is online right now.
It is a separate product from deploying. You do not need to host your app on Vantrex to use it, and if you do, you do not have to link the two.
## What you see
A home for all your apps. Each analytics project has a card with a picture of your site, its address and when it was last active. Above them are four summaries: logins, sign-ups, people online now, and the project with the most activity.
Logins and sign-ups. Pick all your projects or one. You get totals and a success rate, a chart over time, and then the questions you usually end up asking: which countries, which browsers and devices, how long it took, and why the failed ones failed.
Active users. A map of who is on your site right now, with a list of their page and device. If you choose to collect names or emails, they show up here too, so "who is online" can be an actual answer.
Settings that stay out of your way. Rotate the secret key, choose which details of signed-in people are kept, change the project's name or address, copy the project ID, and export everything stored for a project as CSV or JSON.
## Two keys, on purpose
Every project has two keys.
The publishable key goes in the browser. It can tell Vantrex that someone is on a page and that a button was clicked, and nothing else.
The secret key stays on your server. It is the only key that can report a sign-in or a sign-up, because a browser can be made to claim anything. A failed login from your server is as easy to report as a successful one, and it is the failed ones that teach you the most.
If a secret key ever leaks, rotate it. The new one is shown once and the old one keeps working for ten minutes so you can roll the change out without dropping events.
Setting it up
npm install @vantrex/analytics
Add the component to your layout:
import { VantrexAnalytics } from "@vantrex/analytics/next";
// inside <body>
<VantrexAnalytics />Then report from your server, after the code that signs someone in:
import { createAnalytics } from "@vantrex/analytics/server";
const analytics = createAnalytics(); // reads VANTREX_ANALYTICS_SECRET
await analytics.trackLogin({ userId: user.id, email: user.email, request });
Pass the incoming request and Vantrex works out the country and browser from it and connects the person to the tab they have open. If you use Better Auth there is a single hook that reports sign-ins, sign-ups and failures for you.
The calls never throw into your code. If Vantrex cannot be reached the event is retried once and then handed to an onError function if you gave one, so analytics can never be the reason someone cannot sign in.
It is not part of deploying
Analytics runs as its own service, with its own release process and its own line on the status page. If deployments are slow or down, your numbers keep arriving. If analytics has a problem, your deployments are not affected.
You can link an analytics project to one of your deploy projects. A linked project can be filtered by deployment, so you can see whether last night's release changed your sign-up rate, and its keys also show up in the deploy project's settings. Unlinked projects work the same, without the filter.
Your data
You decide what is stored about signed-in people: user ID, name, email, or none of them. Anything you leave off is dropped when it arrives. IP addresses are used to work out the country and are not stored. Raw events are kept for 90 days, you can download them any time, and deleting a project or your account removes them.
An API for everything
Everything the dashboard does is available over HTTP at api.analytics.vantrex.cloud, so you can send events from any language and read your statistics from your own tools. Create an access token with the new analytics scope under Account, Tokens. The API reference lists every request, field and limit.
What it does not do yet
We would rather be clear about the edges of a first version:
- It needs a server part, so plain HTML sites are not supported yet.
- The live list is approximate. A person counts as online if their browser reported in during the last two minutes, so someone who closes a tab abruptly can linger for a short while.
- Browsers do not guarantee delivery when a page is closing, so a few clicks at the end of a visit can be missed.
- The map shows countries, not cities.
Analytics projects are free, with up to 20 per account. The limits are listed in the docs.
Get started
1. Open app.vantrex.cloud, choose New project, then Analytics.
2. Copy the two keys. The secret one is shown once.
3. Follow the SDK guide.
If something is unclear, missing or wrong, tell us. It is the most useful thing you can do for us right now.
