Your events, no SDK.
Post JSON from any server, script or web page. Watch it arrive, count it by any field, and take it all with you as NDJSON.
How it works
Collect events
Your websites and services post JSON to a source, and nf tails, counts and exports it.
- No SDK: any server, script or web page posts with the source's token
- Limit a source to your own origins, so other sites' pages can't post
- Live for 7 days, then counted from an archive kept 90 days, or up to 13 months
- Never the sender's address or browser
Send whatever you like
An event is any JSON object up to 4 KB, kept as you sent it. Post one, or up to 100 in an array.
- event names it, and time says when it happened if not when it arrived; both are optional
- Nest fields as deep as you like: user.country is a path
- Add your own id to count a resent event once
Count by anything you sent
Name a field by its path to group by it or filter on it, over any window the archive keeps.
- --by groups, --where filters, as often as you like
- --every hour or day for a count over time
- --json for the same table as data, for a script or your assistant
From a web page
A token in a page is public: limit the source to your origins with --origin, and keep its --rate to what you'd pay for. Nothing keeps the visitor's address or browser.
fetch("https://ingest.nine.fish/v1/events", {
method: "POST",
headers: {
authorization: "Bearer nfin_…",
"content-type": "application/json",
},
body: JSON.stringify({
event: "page.viewed",
path: location.pathname,
}),
keepalive: true,
});From a server, with retries
Only a 202 means every event was stored. Wait as long as Retry-After says, then send the same batch again.
- A 4xx stores nothing, the rate limit's 429 included
- After a 503 some may be stored, so an id in each event keeps counts true
const INGEST = "https://ingest.nine.fish/v1/events";
async function send(events) {
for (;;) {
const res = await fetch(INGEST, {
method: "POST",
headers: {
authorization: "Bearer " + process.env.EVENTS_TOKEN,
"content-type": "application/json",
},
body: JSON.stringify(events),
});
if (res.status === 202) return;
if (res.status !== 429 && res.status !== 503)
throw new Error("refused: " + res.status);
const wait = Number(res.headers.get("retry-after") ?? 1);
await new Promise((r) => setTimeout(r, wait * 1000));
}
}Take it with you
Export any days the archive keeps as NDJSON, every event whole, and add up or chart it with your own tools.
- Free: only counting is charged
- Sums, averages and searches start here
Look after the token
Raise or lower a source's limit as you go, and swap its token without dropping an event.
- 600 events a minute unless you say, up to 6,000
- The old token keeps working 24 hours after a rotation
- Rotating asks for your passkey
What it costs
Only while it’s active and as it succeeds. No seats or subscription.
100,000 events a month, kept 90 days and counted 50 times
- Analytics events, per millionA$20.00
- Analytics storage, per GB a dayA$0.005
- Analytics history counted, per GB scannedA$0.02
100,000 events, 30 days of an archive of about 54 MB and 50 counts, each at least 10 MB scanned: A$2.00 + A$0.01 + A$0.01 = A$2.02.
Questions
Can I collect events from my websites and services?
Yes: they post JSON to a source, and nf tails, counts and exports it.
Any server, script or web page posts with the source's token, with no SDK. The last 7 days are live, and the archive keeps 90 days unless you choose from 7 days to 13 months. It is a store of events, not dashboards or funnels, and it never keeps the address or browser of whoever sent one.
What does analytics cost?
A$20 a million events, plus what the archive holds and the history you count.
The archive is A$0.005 a GB a day, compressed, and counting history is A$0.02 a GB scanned, at least 10 MB a count. Tailing and exporting are free. A source takes 600 events a minute unless you raise it, so a token that leaks costs at most about A$17 a day.
What can an event hold?
Any JSON object up to 4 KB.
Every field is kept as you sent it, nested or not. Two are optional and checked: event, a name of up to 100 characters that --event filters on, and time, an ISO 8601 instant for when it happened if that isn’t when it arrived. A request carries one event, or up to 100 in an array and 256 KB.
How do I count by something I sent?
Name it by its path: --by plan, or --where user.country=AU.
Group with --by, filter with --where as often as you like, and add --every hour or day for a count over time. --where matches a value exactly, compared as text, and --by groups single values: a list or an object counts as (none).
Can I add up or average a field?
Not in nf: it counts.
Export the days you want and add them up with your own tools, such as jq or a spreadsheet. An export is every event, whole, one JSON line each, and it’s free.
Can I find one particular event?
In the last 7 days with nf analytics tail --since; before that, by exporting.
tail prints every event whole, so grep or jq finds the one you want. Older events are in the archive, which you export by the day.
How soon can I see an event?
In tail about 10 seconds after it’s posted, and in counts within a few minutes.
tail waits 10 seconds so events show in the order they arrived. Counts read the archive, which is written about a minute behind.
What if a post fails?
Send it again: only a 202 means every event was stored.
A 4xx stores nothing, the rate limit’s 429 included, and a 429 or 503 says in Retry-After when to try again. After a 503 some events may have been stored, so a resend can store them twice: put your own id in each event if you need to count them once.
Is the token safe in a web page?
It’s public there, so limit what it can do.
Allow only your own origins with --origin, so other sites’ pages can’t post, and keep --rate to what you’d pay for: at the default 600 a minute, a leaked token costs at most about A$17 a day. nf analytics rotate-token gives a new one, and the old one keeps working 24 hours while you swap it.
What happens at the rate limit?
Posts get a 429 until the next minute.
A source takes 600 events a minute unless you raise it with --rate, up to 6,000. Nothing else stops, and the spend alert tells you if a month passes the amount you set.
How long are events kept?
90 days, or anything from 7 days to 13 months.
Set it with --retention-days. Lowering it deletes the older days. Removing a source stops its token at once and deletes its events within a day.
What do you keep about whoever sent an event?
Nothing: not their address, not their browser.
Only what the event says and when it arrived. What goes in an event is yours to choose, so leave out anything personal you don’t need.
Are there dashboards?
No: it stores and counts events, and your tools do the rest.
Counts come as a table from nf or as JSON from the API, so your assistant or a script can chart them, or check them on a schedule.