All docsSearch docs

Start

  1. 01Getting started
  2. 02Install
  3. 03Tracking

Features

  1. 04The dashboard
  2. 05Goals
  3. 06Short links
  4. 07AI sources and agents
  5. 08Email reports
  6. 09Scheduled check
  7. 10Ask your AI

Reference

  1. 11Performance
  2. 12Configuration
  3. 13HTTP API

Platforms

  1. 14Standalone server
  2. 15ClickHouse
  3. 16PHP
  4. 17WordPress
  5. 18Drupal
  6. 19Craft CMS
  7. 20Webflow
  8. 21Python
  9. 22Rails
  10. 23Ruby
  11. 24Go
  12. 25Java
  13. 26.NET
  14. 27Elixir
  15. 28Rust

Trust

  1. 29Privacy

Features

Scheduled check

One request an hour keeps salts, reports, retention, and daily totals up to date.

Once an hour, Runlight makes the day’s new salt for counting visitors and deletes the old ones. The same run sends any email reports that are due and deletes visits older than a site keeps. It also adds up each finished day, so long ranges load quickly.

This upkeep happens when something calls the check.

bash

curl -X POST https://example.com/runlight/api/check -H "Authorization: Bearer $CRON_SECRET"

The check accepts GET or POST, with CRON_SECRET (or the dashboard token) as a bearer token. Calling it more often does no harm.

Visits are counted correctly without the check, because the first visit of the day also makes the salt. Without the check, no reports go out and visits past a site’s retention are kept. Long ranges also stay slower, since they read every visit.

Vercel

Set CRON_SECRET in the project’s environment, then add the cron to vercel.json.

vercel.json

{
  "crons": [{ "path": "/runlight/api/check", "schedule": "0 * * * *" }]
}

Vercel calls it with GET and the secret as a bearer token, which is what Runlight expects.

Anywhere else

Any scheduler that can make an HTTPS request will work, including a crontab line, GitHub Actions, Cloudflare Cron Triggers, or your platform’s scheduler.

bash

0 * * * * curl -fsS -X POST https://example.com/runlight/api/check -H "Authorization: Bearer YOUR_CRON_SECRET" > /dev/null

You can also call await rl.check() from code you already run on a timer. Each language’s page shows its own way to run the check, such as bin/rails runlight:check in Rails or a hosted service in .NET. The standalone servers run it themselves every five minutes.

Check failures

A check that cannot finish retention cleanup fails instead of reporting success. Email delivery is tracked separately: inspect reports.failed in the result, even when the check returns successfully. In the Node standalone server, optional CronWatch monitoring alerts for either kind of failure and records successful checks with no reports due as normal.