Business metrics gateway
Publish bounded billing and website metrics through the existing Oblive backend.
The gateway requires a dedicated server-to-server bearer token for GET /public/v1/businesses/{businessId}/metrics. It is disabled by default. Deploy the gateway in each business’s existing Oblive backend, with only that business in its registry. Each instance uses its own ShoutOut or SocialKit source credentials or its Paddle integration, an optional GA4 or Plausible integration, database and Redis. The dashboard server selects the business’s gateway URL and attaches one shared METRICS_GATEWAY_TOKEN; gateway and source credentials never reach the browser. There is no separate gateway container or deployment pipeline.
Scope and dependencies
The implementation lives in apps/backend/src/services/business-metrics-gateway. It reads ShoutOut aggregate REST endpoints, SocialKit admin MCP, Paddle Billing’s REST API through the instance’s Paddle integration, the existing GA4 integration, and Plausible’s Stats API through the instance’s Plausible integration. Business systems own history; Redis holds a disposable normalized cache. There are no new tables, collectors, or agents.
The ShoutOut private routes and SocialKit get_billing_observations export are separate business-repo prerequisites. Paddle and Plausible are vendor APIs that need the key permissions and plan described below. Their contracts below are required, not a claim that they are deployed. Existing internal dashboards are unchanged. No production access or historical coverage is established by gateway fixture tests.
Configure each business instance
Add businessMetricsGateway to the ignored config/local-stack.json, then use bun run stack env. Production supplies the equivalent BUSINESS_METRICS_GATEWAY_CONFIG JSON through its secret boundary. Do not edit generated environment files. Omission or exactly { "enabled": false } disables publication. For installed deployments, edit the file from oblive --instance <name> config path, run config check, then apply it with start --no-open. Validate before applying: invalid gateway configuration prevents backend startup.
{
"enabled": true,
"readToken": "REPLACE_WITH_A_RANDOM_GATEWAY_READ_TOKEN",
"businesses": {
"devout": {
"enabled": true,
"name": "Devout",
"organizationId": "11111111-1111-4111-8111-111111111111",
"historyFrom": "2026-10-01",
"costEffectiveFrom": "2026-10-01",
"source": {
"kind": "shoutout",
"origin": "https://backoffice.example.com",
"token": "REPLACE_WITH_PRIVATE_READ_TOKEN"
},
"traffic": {
"integrationId": "22222222-2222-4222-8222-222222222222",
"propertyId": "123456789",
"hostnames": ["www.example.com"],
"marketingSurface": true,
"historyFrom": "2026-10-01",
"timeZone": "UTC"
}
}
}
}Replace every example identifier and coverage date with verified configuration. Optional takeoverDate and mrrGoal are display metadata. The example belongs only in ShoutOut’s instance. In SocialKit’s instance, configure only the devkit entry, name Devkit, source.kind: "socialkit", its MCP token and origin, its scoped hostname, and marketingSurface: false. Its shared GA4 property must not be queried without the hostname filter. Tokens remain server-side; SocialKit’s admin token is broader than the two tools this gateway calls and requires renewal.
In Redreach’s instance, configure only the devreach entry, name Devreach. Its billing and traffic are read through the instance’s Paddle and Plausible integrations, which hold the keys; the entry names only the integrations:
{
"devreach": {
"enabled": true,
"name": "Devreach",
"organizationId": "33333333-3333-4333-8333-333333333333",
"historyFrom": "2025-11-01",
"costEffectiveFrom": "2025-11-01",
"source": {
"kind": "paddle",
"integrationId": "44444444-4444-4444-8444-444444444444"
},
"traffic": {
"kind": "plausible",
"integrationId": "55555555-5555-4555-8555-555555555555",
"siteId": "example.com",
"hostnames": ["example.com"],
"excludedEntryPaths": ["/app", "/auth", "/oauth", "/dev"],
"historyFrom": "2025-11-01",
"timeZone": "Asia/Makassar"
},
"refreshOnRead": true
}
}A Paddle source names only integrationId, and Plausible traffic names its integrationId with the site and filters. Neither accepts an origin or token: the keys are decrypted inside the backend with that instance’s integration key, as for GA4. To connect them:
- In Redreach’s Oblive workspace, open Integrations → Paddle, paste a live Paddle API key with at least
subscription.readandmetrics.read(the setup instructions list the full read set), and connect. - Open Integrations → Plausible, list the site domain, such as
example.com, under Sites, paste a Plausible Stats API key, and select Connect Plausible. - Confirm each connection check reports Connected — Oblive can access the selected data.
- Set
source.integrationIdandtraffic.integrationIdinconfig/local-stack.json, or in the installed instance’s configuration file, then validate and apply it as described above.
The Integrations page does not display integration IDs; its URLs use the integration key. Read the IDs from that instance’s database, for example select key, id from integrations where organization_id = '<organizationId>' and provider_key in ('paddle', 'plausible');. The same applies to a GA4 traffic.integrationId.
Every request resolves each integration by ID within the entry’s organizationId. The Paddle integration must be the Paddle catalog runtime, enabled, catalog-active and credentialed, with paddle_list_subscriptions enabled; any access mode works because the gateway only reads. The Plausible integration must be the Plausible catalog runtime, enabled, catalog-active, read-only and credentialed, with plausible_query enabled and siteId among its sites. Otherwise the billing metrics or website traffic are unavailable with source_unavailable, while the other source and cost remain available. Each integration’s revision (id:connectionRevision:updatedAt) joins the cache key and is rechecked before a response is returned, so reconnecting, rotating a key or changing settings starts a fresh cache entry; an unusable integration also has its own key, so no earlier reading is reused. A failed read under a usable integration keeps the cached reading for up to an hour, marked source_unavailable. ShoutOut and SocialKit keep their existing cache keys.
The Paddle key’s prefix selects the API: a pdl_live_apikey_ key reads https://api.paddle.com and a pdl_sdbx_apikey_ key reads https://sandbox-api.paddle.com. Existing Paddle keys do not inherit metrics.read. Paddle’s metrics API is not available in sandbox, so a sandbox key, or a live key without metrics.read, publishes estimated list-price MRR instead of Paddle’s own MRR. Paddle reports metrics in the account’s primary balance currency, which must be USD; otherwise MRR is unavailable. The same integration also feeds Paddle’s Insights collection and agent tools.
Plausible traffic needs the Stats API, which requires a Plausible plan that includes it, such as Business. A key shares a default limit of 600 requests per hour with agent tools and Insights; each gateway refresh makes two requests. siteId is the site domain as added to Plausible. hostnames match each visit’s entry-page hostname, which Plausible stores without a leading www.. excludedEntryPaths are lowercase path prefixes, such as a signed-in product under /app, whose visits begin outside the website. timeZone must equal the site’s Plausible reporting timezone exactly; a mismatch fails closed.
traffic is optional for every business. Without it, website sessions are reported as unsupported: the metric has a fetch time and no values or outage warning. Use this when no analytics source is available, for example when a Plausible plan lacks Stats API access. Configured ShoutOut traffic must still be GA4 with marketingSurface: true.
GA4 must be enabled, read-only, and authorize the property and google_analytics_run_report. ShoutOut also requires google_analytics_list_custom_definitions, a registered event-scoped surface dimension, and marketingSurface: true. Registration and the actual scoped report must succeed; an incompatible filter makes traffic unavailable. A timezone mismatch fails closed until configuration is corrected. No source URL, property, or credential is accepted in browser query parameters.
The dashboard preserves its Clerk sign-in requirement. Independently, both gateway routes require Authorization: Bearer <readToken> before any cache or source access. Use a dedicated random token of 32–512 URL-safe characters (A-Z, a-z, 0-9, _, -), distinct from the business source token. Enabled configuration without a valid token is rejected. Use the same root readToken in every instance and set its matching server-only METRICS_GATEWAY_TOKEN in the dashboard. Set DEVKIT_METRICS_GATEWAY_URL to SocialKit’s Oblive origin, DEVOUT_METRICS_GATEWAY_URL to ShoutOut’s Oblive origin, and DEVREACH_METRICS_GATEWAY_URL to Redreach’s Oblive origin. These are Oblive URLs, not the business API origins in source.origin. Use HTTPS outside trusted local connections; never put tokens in browser code, query parameters, or logs. Rotate by updating every Oblive instance and the dashboard together and reloading them. Use a separate shared token per environment. Keep the Oblive instances private and expose the dashboard relay.
Registry keys are canonical public IDs, independent of source kind. Use devkit, devout and devreach for the existing workspaces; socialkit, shoutout and redreach are reserved. Names (80 characters) and optional descriptions (240 characters) are public display text. The registry schema still supports up to 200 entries, but configure exactly one business per instance for this deployment. No registry or adapter rewrite is needed. Set an entry’s enabled to false to stop its metrics. There is no legacy singleton configuration fallback. The dashboard routes devkit, devout and devreach; another business requires an explicit dashboard server routing entry and URL.
GA4, Paddle and Plausible integrations must be connected in the respective business’s Oblive deployment under the configured organization and decrypted with its own integration credentials. Another deployment’s integration ID or encrypted database row is insufficient. Do not copy database rows or share encryption keys to provision this feature. Replicas of the same instance must use the same registry and read token. Different business instances retain their own configuration, credentials and encryption keys. Paddle and Plausible keys live only in that instance’s encrypted integrations, never in gateway configuration.
GET /public/v1/businesses uses the same token, takes no query parameters, and returns { "version": 1, "businesses": [{ "id": "devout", "name": "Devout" }] } in the standard data envelope. It lists enabled public metadata in ID order, without billing/GA4/Redis calls or source credentials. The dashboard uses its configured workspace metadata for its own catalog, without contacting these gateway catalogs. A gateway outage therefore leaves every configured workspace visible; only that business’s metrics become unavailable. Removing its dashboard URL disables those charts while existing activity remains available.
Requests and refreshes
GET /public/v1/businesses/devout/metrics?from=2026-10-01&to=2026-10-20&interval=day
Authorization: Bearer <readToken>Dates are inclusive, ordered, and at most 366 days. Only from, to, and optional interval=day|week|month are accepted. Responses use the standard data envelope and Cache-Control: no-store. Server-side Redis caching still applies.
Page loads and range changes read the same bounded history bundle. Once cached data is five minutes old, an in-process single-flight promise makes concurrent requests share one refresh. The existing Redis lease coordinates refresh ownership across backend processes with a twenty-second limit; Redis retains the result across process restarts. There is no periodic gateway job and no forced-refresh parameter. An entry with refreshOnRead: true instead refreshes on every request: concurrent requests still share one refresh, and if the refresh fails the last usable reading is served with its own fetch times. Failed sources cannot extend the successful-fetch time of older data. Stale results expire after one hour; Redis failure fails closed. Source bodies, cache bundles, and responses are bounded to 2 MiB, with at most 10,000 normalized points. Each selected business configuration, shared-token revision, traffic connection revision and, for a Paddle source, Paddle connection revision has its own cache key; editing one business leaves other caches warm. At most 16 distinct refreshes run per backend process; warm reads and joins remain available, and excess new refreshes return 503 without queuing. Old cache keys expire through their existing one-hour TTL. Shared-token rotation must be coordinated across instances and the dashboard; access is rechecked before return. Shutdown cancels refreshes before closing Redis.
Metric meaning
Every primary count card uses Subscriptions. ShoutOut retains backend payingStores; SocialKit and Paddle use activeSubscriptions. Provider accounts remain a separately labeled count. ShoutOut account churn and SocialKit subscription churn are estimates, never interchangeable with store churn. Missing or zero opening populations have no churn rate.
Each metric separates latest, rangeEnd, and series, with source time, calculation time, fetch time, timezone, coverage, and warnings. Nulls retain missing-history evidence; the UI may visually connect known observations while labeling gaps and observed/estimated boundaries. Observed and estimated segments need distinct visual and text labels. Native monthly churn stays monthly even when the request asks for daily points. Sessions sum only supported days in larger buckets. Recent GA reports can change, and omitted dates are not invented zeros.
Paddle billing uses UTC calendar days. MRR is Paddle’s own daily monthly recurring revenue, converted from USD minor units: recurring revenue from active subscriptions, excluding one-time purchases such as day passes and excluding Paddle fees. Each point carries Paddle’s last refresh time as its calculation time. Days that began after that refresh are omitted rather than published as zero, and a refresh older than 36 hours adds source_stale. MRR is a level, so a same-day value is Paddle’s reading at its refresh, not a partial period.
Subscriptions, paying customers and churn come from one bounded pass over Paddle subscriptions that are active, past due, paused or canceled. Beyond 50 pages of 200, those three metrics are unavailable rather than understated. The current subscription count is the number of active or past-due subscriptions at fetch time, labelled Observed. Daily history is reconstructed from each subscription’s first billing time and the time its current cancellation or pause took effect. It is labelled Estimated with a separate definition, because Paddle does not retain earlier pauses or past-due periods. Reconstructed and MRR points share UTC dates, so ARPU can use the closed previous day. Paying customers are distinct customers with an active or past-due subscription, current only. Monthly churn is an estimate: the share of subscriptions paying at the start of a UTC month whose cancellation took effect within that month. The current month is partial and excludes cancellations that are only scheduled. Trials that never billed are excluded throughout. Paddle supplies no Revenue, blended run rate or goal driver blocks.
When Paddle answers the metrics request with 404 not_available_in_sandbox or 403, MRR is estimated from the same subscription pass, with no extra request. Each active or past-due subscription contributes the list price of its active recurring items: unit_price.amount × quantity, divided by the billing-cycle frequency and converted to a month (a year counts as 12 months, a week as 12/52 and a day as 12/365 of a month). One-time and trial items are excluded. Subscription list payloads carry no discount amounts, so the value is before discounts, as well as before tax and fees. Subscriptions or items not priced in USD are excluded and mark the estimate incomplete. The current value and the reconstructed daily history are both Estimated, with definition paddle-list-price-mrr-v1. History uses each subscription’s current items over its whole paying span; a paused subscription’s inactive items count before its pause. Any other metrics failure leaves MRR unavailable.
Plausible traffic counts daily visits (sessions) in the site’s reporting timezone through the last closed day. It includes visits whose entry page is on a configured hostname and outside the excluded paths. A successful report’s calendar labels turn days without visits into zero; a failed read publishes nothing. Plausible visits are cookieless and differ from GA4 sessions, so their definition never joins a GA4 series. Google Analytics sampling, thresholding and processing notices do not apply.
SocialKit can additionally return optional performance: { version: 1, range: { from, to, interval: "day" }, series: [...] }, containing only blendedMonthlyRunRate. This estimate adds trailing 30-day net non-subscription order cash to the existing subscription MRR at each billing observation. It includes qualifying one-time orders, USD tax and currently recorded refunds; it is not pure recurring revenue. Historical blended points are reconstructed and labeled Estimated. The MRR headline and goal remain subscription MRR. The companion stays daily even for a grouped base request, and absent or invalid optional source fields leave the established metrics available.
The gateway obtains both revenue values from one get_billing_observations result and publishes them atomically. Its internal v3 cache uses a new cache revision in the key; rollback can reuse the old key until normal expiry. Failed observation reads retain cached current MRR and its blended companion within the existing stale bound, even when the monthly report succeeds. Without usable cached current MRR, monthly estimates remain available as history only. Successful observation reads without blended support clear the companion rather than mixing generations. No new credentials, environment variables, tables or traffic queries are required. Deploy the additive SocialKit export, compatible dashboard support, then the gateway release.
The separate optional revenue report reuses get_revenue_metrics without another source call or SocialKit change. It carries monthly subscription and one-time USD cash, including tax and net of currently recorded refunds. Refunds restate the original transaction month. Its churnedMrr is a hypothetical recurring-revenue estimate, never part of collected cash; the current month can include scheduled future endings. Missing historical cancellation prices can understate this estimate even when billing reports no current pricing issues.
Revenue always represents whole UTC calendar months intersecting the selected dates, independently of the requested interval. The month containing historyFrom may therefore include earlier days when the source explicitly reports that whole-month total; the gateway never invents a partial-month allocation. The current source month is marked partial. Source-wide cashComplete and billingComplete are independent quality flags, not proof of exhaustive accounting or historical churn coverage. Invalid cash sums become unknown; an invalid churn amount does not erase valid cash. Missing months remain gaps, and explicit zero amounts remain zero.
Revenue uses the existing cache with key revision 6 and preserves its own original source/fetch times across fallback. Both ages must be nonfuture and within one hour. Expiry removes its values; absent or malformed optional reports leave core metrics available. A cold source failure with no prior Revenue report omits the optional block. Cache and response limits include Revenue, which is discarded first if adding it would exceed an otherwise valid core payload. Release the compatible dashboard before the gateway; existing source deployments already expose the required fields. No authentication, environment, database or internal admin changes are needed.
SocialKit can also add optional goalDrivers: { version: 1, range: { from, to, interval: "day" }, metrics: [...] }. This leaves the six established metric IDs unchanged. Drivers retain their original sourceAsOf; another fetch cannot rejuvenate an old source. Missing tools, malformed optional responses and individual failures leave billing available. Deploy the additive SocialKit tools before the gateway for these cards to populate; no new environment variables, tokens or database tables are required.
signups: daily retained non-admin user counts fromget_signup_metrics({ from, to }). Dates use the established ObjectId creation clock, rather than the unreliablecreatedAt. Counts are estimated reconstructions: deletions and past role changes cannot be recovered. Today’s count is partial.signupConversionRate:get_conversion_metrics({})supplies the mature 30-day first-positive-net-cash conversion for users signing up in the trailing 90 UTC dates. Users without 30 elapsed days are excluded. It reuses SocialKit’s existing cash and cohort calculation, includes current refunds, and exposes aggregate counts only. Missing eligible users or incomplete billing makes the rate unavailable. Unlinked payments and retained-user coverage mean the rate remains estimated and partial.apiErrorRate:get_usage_metrics({ days: 30, failureScope: "operational" })supplies daily success and operational-failure counts. The gateway uses100 × failure / (success + failure), excluding ordinary client errors from the denominator. No eligible requests means unavailable, not zero percent. The observation time comes frommetadata.seriesObservedAt. Retained logs and buffered recent requests make this a partial estimate.
Conversion and API error rate are current-only windows, with no daily history or takeover comparison. Signups keep available daily reconstruction. ShoutOut’s optional signups driver reads /api/private/v1/business-metrics/merchants/timeseries under its existing business read token and is labeled Merchant accounts created. The direct, uncached query returns sparse merchantsCreated UTC buckets for retained merchant ObjectIds; only a successful bounded response can fill omitted days with zero. These estimates are not distinct-store signups or first-ever installs. Their source timestamp describes query freshness, not an observed signup timestamp. ShoutOut has no mature store-conversion or complete operational-error export today; support reply time needs a reporting source for both businesses. Unsupported cards stay unavailable. Driver snapshots use the existing freshness, expiry and single-refresh rules; cache-key revision 6 isolates this additive bundle from older releases.
Steve cost estimates retained task-attempt tokens in USD, attributed to each attempt’s UTC start date. Failed and retried attempts count once each when usage was reported. The dashboard shows the selected-period sum, labelled Estimated; missing usage and unpriced models retain partial coverage. Legacy positive token counts use a coarser estimate without cache detail. Legacy zero rows and dates before retained history are unknown. Model/harness identities remain private. costEffectiveFrom remains accepted for configuration compatibility but no longer manufactures cost values.
Pricing runs only during the normal gateway refresh, from the existing local database and a bundled models.dev reference rate card. There is no new table, service, token, environment variable or provider request on a page load. Rate-card revision participates in the cache key; deploying a reviewed update intentionally restates reference-priced history. Refresh the compact card with bun run apps/backend/src/commands/model-token-rates.command.ts (optional provider keys follow the command). Validate and review the generated card before release. Standard reference rates apply because whole-turn usage cannot establish per-request context/service tiers. Reasoning tokens are already included in output. Preserve fractional USD until display. The source is an estimate, not an invoice ledger.
Release the compatible dashboard before the new backend, then update workers after the backend accepts optional usage details. Existing workers remain accepted. The cost reader has a five-second PostgreSQL statement timeout; cost failure leaves other metrics available. Gross margin remains excluded. Neither the gateway nor dashboard writes ShoutOut observations or applies historical backfills.
Required upstream contracts
ShoutOut uses bearer-authenticated GET routes under /api/private/v1/business-metrics. Existing handlers retain their { data, meta } envelopes:
/subscriptions/current?excludeTrials=truereturns the existing generated snapshot with provider metrics./subscriptions/timeseriesreceives UTC ISO timestamps (frominclusive,toexclusive),interval=day,timeZone=UTC,excludeTrials=true, andmetric=subscription.mrrorsubscription.paying_users. MRR also requestscurrency=USD. Only Shopify/Stripe provider totals are summed; plan rows are excluded./billingreceives bounded monthly UTC ISO timestamps with the same exclusive-end convention andtimeZone=UTC. The gateway readsdata.current.openingAccounts,churnRate, andproviderCoverage.- New
/countsreturns{ "data": { "version": 1, "current": POINT_OR_NULL } }. - New
/counts/timeseries?from=...&to=...returns{ "data": { "version": 1, "points": [POINT] } }, at most one point per UTC day.
A count point has the following explicit fields. Estimated backfills use basis: "estimated", their measurement date, the real calculation timestamp, and no invented observation timestamp. Incomplete current mapping can return a known value with complete: false.
{
"date": "2026-10-20",
"periodEnd": "2026-10-20",
"value": 42,
"measuredAt": "2026-10-20T18:00:00.000Z",
"calculatedAt": "2026-10-20T18:00:01.000Z",
"basis": "observed",
"definitionVersion": "paying-stores-v1",
"complete": true,
"partialPeriod": false,
"breakBefore": false
}SocialKit uses the existing authenticated POST /api/admin/mcp transport. New get_billing_observations({from,to}) must return:
{
"data": {
"version": 1,
"current": {
"observedAt": "2026-10-20T18:00:00.000Z",
"mrr": 1200,
"count": 40,
"complete": true,
"version": "recurring-v2",
"restatement": false,
"payingCustomers": 38,
"customerIdentityComplete": true
},
"observations": []
}
}Each observation has the same fields as current except customer count and identity completeness; cap the export at 1,000 observations for the requested window. Recorded rows retain their source measurement time, definition, completeness and restatement flag. Newer SocialKit exports also return daily invoice-based MRR and subscription-count reconstructions before recording began, with version: "legacy". For those rows, observedAt is a calculation boundary, not a capture time: the gateway publishes Estimated points with no measurement time, the current source report’s calculation time, incomplete coverage and a separate definition. Existing admin readers and stored snapshots are unchanged. Missing days after recording began remain gaps; historical distinct-customer counts remain unavailable.
SocialKit’s restatement flag means that a retained row was corrected to its exported version; it does not imply a discontinuity from the previous day. Corrected rows with the same definition stay connected. The gateway still marks actual definition changes and missing history as series boundaries, and incomplete values keep their coverage labels.
Each current/history billing row may add blended with value, nonSubscriptionNetCash30d, at, windowFrom, windowTo, complete, calculatedAt, sourceAsOf and definitionVersion: "blended30d-v1". Both at and windowTo equal the row’s observedAt; windowFrom is exactly 30 elapsed days earlier, inclusive. The source report’s shared sourceAsOf may differ from the billing anchor and is retained separately from calculation/fetch time for freshness and one-hour expiry. The current blended payload supplies that timestamp, falling back to a historical payload when absent or invalid; rows with a different report timestamp are rejected. Unknown cash or an observation newer than that source makes blended unavailable, not zero. The gateway validates the sum and anchor before publishing; older exports can omit the object. No raw orders or customer identities are exposed.
Existing get_revenue_metrics({}) supplies data.reporting.observedAt and monthly churn rows. Its optional monthly MRR fields (mrr, mrrMethod, mrrObservedAt) provide a fallback for sources without the daily legacy export: a non-null MRR with mrrMethod: "legacy" and mrrObservedAt: null is shown only at that completed month-end, before returned daily history, with a separate estimated definition and incomplete coverage. It never overwrites daily values, supplies a current value, or invents subscription counts. Months without those fields remain unavailable. The gateway does not export raw tool responses or accept arbitrary tool names. Customer IDs and billing issues containing identities must remain private.
Paddle requests send Authorization: Bearer <key> and Paddle-Version: 1 to the origin that matches the integration’s key:
GET /metrics/monthly-recurring-revenue?from=YYYY-MM-DD&to=YYYY-MM-DD, with an inclusivefromand exclusiveto, in chunks of at most 90 days. Each report must returncurrency_code: "USD",interval: "day",starts_atandends_atequal to the requested bounds, UTC-midnighttimestampvalues with minor-unitamountstrings, andupdated_at. Requiresmetrics.read. Sandbox returns404with error codenot_available_in_sandbox, and a key without the permission returns403; both select the list-price estimate.GET /subscriptions?status=active,past_due,paused,canceled&order_by=id[ASC]&per_page=200withSkip-Count: true, following theaftercursor inmeta.pagination.nextwhilehas_moreis true. The cursor must equal the page’s last subscription ID. The gateway reads onlyid,status,customer_id,first_billed_at,canceled_at,paused_at,currency_code, and each item’sstatus,quantity,price.unit_priceandprice.billing_cycle. Requiressubscription.read.
Plausible requests send Authorization: Bearer <Stats API key> to https://plausible.io:
GET /api/v1/sites/{siteId}must return the configureddomainandtimezone.POST /api/v2/querysendssite_id,metrics: ["visits"],date_range: [from, to],dimensions: ["time:day"], the filter["is", "visit:entry_page_hostname", hostnames], and, when paths are excluded,["matches_not", "visit:entry_page", ["^(?:/app|/auth)(?:/|$)"]]. It requestsinclude: { "time_labels": true, "imports": false };meta.time_labelsmust list exactly the requested dates. Imported data is excluded.
Verification and rollback
Run the gateway HTTP, adapter, cache and normalization tests, GA4, Paddle and Plausible provider tests, environment/stack tests, backend typecheck, and OpenAPI checks. Validate source contracts and retained coverage with the business owners before enabling publication. Verify property/host scope using actual GA data before launch. For Paddle, compare published MRR and subscriptions with Paddle’s dashboard, and confirm that the balance currency is USD and no recurring price bills daily or weekly. For Plausible, confirm the site timezone, hostnames and excluded paths against actual reports.
To stop all publishing on an instance, replace the entire businessMetricsGateway value with exactly { "enabled": false }, validate, and regenerate/reload configuration. Keeping readToken or businesses beside root enabled: false fails the strict schema. To stop one entry, set that entry’s enabled to false. Clear its dashboard gateway URL to restore its activity-only view. No historical data is deleted. This feature adds no agent control-plane operation, so no oblivectl command is required.