The dashboard, its JSON API, the tracker's script and endpoint, short links' API, OAuth, and the MCP server, under one base path (the SDK's routes.ts). Every answer is the SDK's byte for byte.
Make them with Runlight.routes/2 and answer a request with handle/2;
Runlight.Plug does both for a Phoenix router or a Plug.Router.
Options, the SDK's in snake case:
:base_path- where the routes are mounted, default "/runlight".:token- required to read stats, sent asAuthorization: Bearer <token>, or once as?token=<token>, which moves it into a cookie. Left out (or nil), it isRUNLIGHT_TOKEN.falseleaves the routes open, for routes behind the app's own authentication. Without a token the dashboard runs open only in development, and answers 503 elsewhere.:authorize- your own check instead of a token, a function of the request answering true, "member", "read", or false.:accounts- true for sign-in accounts, with people and roles.:cron_secret- also taken as a bearer on /api/check; defaultCRON_SECRET.:observe_key- lets CMS plugins report AI agent fetches; defaultRUNLIGHT_OBSERVE_KEY.:origin- the address people open the app at, such as "https://example.com".:sign_in,:sign_out,:geo_credit,:own_hosts- as the SDK's.
Summary
Functions
An error the dashboard can show in its own language: code names it and
params fill its placeholders, while error stays the English message.
Whether the app runs in development: NODE_ENV or RUNLIGHT_ENV is "development", or Mix runs in :dev.
A domain name, such as go.example.com.
Answers one request: a %Runlight.Http.Request{} whose URL is absolute,
under the base path. Anything outside it answers a JSON 404.
A Host or X-Forwarded-Host value as a bare name: lowercase, with no port, no final dot, and no www.
What a manage token, held by a Runlight hub, may read and change: one site's goals, funnels, short links, link domains, email reports, and share links, along with its name, timezone, and retention, and tickets for the element picker.
Types
Functions
An error the dashboard can show in its own language: code names it and
params fill its placeholders, while error stays the English message.
@spec development?() :: boolean()
Whether the app runs in development: NODE_ENV or RUNLIGHT_ENV is "development", or Mix runs in :dev.
A domain name, such as go.example.com.
@spec handle(t(), Runlight.Http.Request.t()) :: Runlight.Http.Response.t()
Answers one request: a %Runlight.Http.Request{} whose URL is absolute,
under the base path. Anything outside it answers a JSON 404.
A Host or X-Forwarded-Host value as a bare name: lowercase, with no port, no final dot, and no www.
What a manage token, held by a Runlight hub, may read and change: one site's goals, funnels, short links, link domains, email reports, and share links, along with its name, timezone, and retention, and tickets for the element picker.