Skip to content

Credentials

A Mostly Right API key downloads the current source manifest. The manifest supplies the endpoints, schemas, and source metadata used by the SDK. The SDK then fetches data directly from each source.

The key comes with the subscription (USD 29/month). Create an account at app.mostlyright.md, subscribe, issue a key, and store it as an environment variable:

Terminal window
export MOSTLYRIGHT_API_KEY="..."

The key authenticates the manifest request. It is not sent to public weather, market, economy, or finance sources.

  1. The SDK requests the current manifest with MOSTLYRIGHT_API_KEY.
  2. The manifest returns the current endpoint, schema, and source definitions.
  3. The SDK requests rows directly from the selected source.

The manifest is not bundled into the packages. This keeps source changes out of package releases while preserving direct source access. Missing or invalid keys raise ApiKeyRequiredError before the SDK calls a source. See the hosted manifest guide for lapse behavior.

VariableUsed forWithout it
MOSTLYRIGHT_API_KEYRequired access to the current Mostly Right source manifestThe SDK cannot resolve source endpoints or schemas and stops before fetching data
FRED_API_KEYALFRED first-print economic vintages and deeper FRED-backed historyLatest-revised agency fallbacks may remain available, but first-print reads can raise with this key named as the fix
BEA_API_KEYBEA GDP fallbackGDP paths that require BEA raise a typed source-availability error
BLS_API_KEYHigher BLS request limitsUnkeyed BLS limits apply
EUMETSAT_CONSUMER_KEY + EUMETSAT_CONSUMER_SECRETMeteosat satellite objectsMeteosat raises a typed error; other satellite families are unaffected
MOSTLYRIGHT_WEATHER_HOSTED_URLOptional hosted weather delivery, including satellite deliveryThe SDK fetches supported weather data directly from its source
MOSTLYRIGHT_FINANCE_HOSTED_URLOptional hosted earnings transcript REST/streamLocal finance paths remain separate
MOSTLYRIGHT_ECONOMY_HOSTED_URLReserved hosted economy transportdelivery="hosted" is unavailable until that transport lands
MOSTLYRIGHT_CACHE_DIRRelocate the local cacheDefaults to ~/.mostlyright/cache/
MOSTLYRIGHT_CWOP_DIRRelocate CWOP registry/capture stateUses the default CWOP location

The hosted names are fully namespaced. WEATHER_HOSTED_URL, EARNINGS_HOSTED_URL, and MOSTLYRIGHT_CWOP_HOME are old names and are not the current configuration contract.

Terminal window
export FRED_API_KEY="..."
export MOSTLYRIGHT_WEATHER_HOSTED_URL="https://weather.example"
export MOSTLYRIGHT_API_KEY="..."

Use a shell profile for local development and your platform’s secret manager in production. Do not commit .env files containing real keys.

  • A missing or invalid MOSTLYRIGHT_API_KEY stops manifest resolution before a source request.
  • Missing source credentials fail loudly with the exact variable named.
  • Invalid source/delivery values fail before network I/O.
  • Credentials change access, not provenance. A row still identifies the source that returned it.
  • Hosted calls require both the service URL and MOSTLYRIGHT_API_KEY.

The TypeScript hosted helpers accept explicit configuration because browsers do not have a safe, general-purpose process environment:

import { satelliteHosted } from "@mostlyrightmd/weather/hosted";
const result = await satelliteHosted({
hostedUrl,
apiKey,
station: "KNYC",
fromTime: "2025-01-06T00:00:00Z",
toTime: "2025-01-07T00:00:00Z",
satellite: "goes16",
});

Do not ship a durable shared API key in a public web bundle. Put credentialed calls behind your backend or mint a short-lived scoped token.