All 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. 11Configuration
  2. 12HTTP API

Platforms

  1. 13Standalone server
  2. 14PHP
  3. 15Python
  4. 16WordPress
  5. 17Drupal
  6. 18Craft CMS
  7. 20Rails
  8. 21Ruby

Trust

  1. 19Privacy

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 it, 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.

Edit this page on GitHub