Enlitt

business.info()

The server-side SDK read of your own business reporting data.

business.info() is the SDK-side entry point into the same read model the business dashboard's Overview page renders (BusinessDashboardInfo) — the two are two entry points into one backend-composed read, so they cannot drift apart.

import { business } from "@enlitt/sdk/server";

const info = await business.info({
  from: "2026-08-01T00:00:00Z",
  to: "2026-09-01T00:00:00Z",
  limit: 25
});

Authentication

business.info() authenticates with a reporting-scope API key (see API keys) through the same resolveBusinessAuthorizationHeader() path every other business credential resolves through — never with a personal session, and never with a model-scope key. Resolution order is query.secretKey, then ENLITT_SECRET_KEY; a missing or unusable key throws before any network request.

Query parameters

FieldMeaning
from / toRFC 3339 bounds of the UTC reporting window. Both default: to to the current instant, from to 30 days before to.
cursorAn opaque next_cursor from a prior page, forwarded unchanged. Never inspect or construct one yourself.
limitThe largest number of applications entries to return in this page.

Response shape

interface BusinessDashboardInfo {
  business: { id: string; name: string; email?: string };
  earnings: { earnings_nano_usd: string; payout_pending_nano_usd: string; display_currency: "USD" };
  payout: {
    eligible: boolean;
    connected_account_status: string;
    policy_code_version: string;
    minimum_available_nano_usd?: string;
    next_eligible_at?: string;
    blocked_reason?: /* present exactly when eligible is false */ string;
  };
  applications: readonly BusinessApplicationSummary[];
  next_cursor: string | null;
  range: { from: string; to: string; timezone: "UTC" };
  data_fresh_at: string;
}

Every NANOUSD amount, the opaque cursor, and the freshness timestamp are validated for shape and carried through unchanged — never parsed into a Number, never reformatted. A money string that survived a round trip through a floating-point number would no longer be the exact amount that was billed; treat every *_nano_usd field the same way in your own code; parse it as an exact integer (BigInt) if you need to do arithmetic on it, never as a JavaScript number.

payout.blocked_reason is present exactly when payout.eligible is false, and is one of: below_minimum, outstanding_deficit, tax_details_required, payout_account_incomplete, monthly_payout_taken, payout_pending.

Each applications entry carries the application's safe identity and status fields, its public client ID, its API keys' safe metadata (never a raw key — see API keys), its daily visitor counts, and a usage distribution split into standard and premium buckets, each with an exact request count and consumed credit units; the premium bucket additionally carries this application's premium earnings in NANOUSD for the window.

Pagination

Page through applications by following next_cursor until it is null. There is currently no reverse-direction cursor: a caller that wants a prior page re-issues the original query rather than paging backward from the current one.

On this page