Skip to content

Axiom Plugin

@theholocron/holocron-plugin-axiom logs

npm · GitHub

Install

pnpm add -D @theholocron/holocron-plugin-axiom

Capabilities

CapabilityToken
logsHOLOCRON_AXIOM_TOKEN (axiom)

Structured log output to Axiom is handled by @theholocron/logger — its Axiom transport reads HOLOCRON_AXIOM_TOKEN + HOLOCRON_AXIOM_DATASET (fallbacks: AXIOM_TOKEN + AXIOM_DATASET) directly at startup. This plugin does not ship log lines.

The logs provider entry is used only by holocron setup (to provision the holocron-ci and holocron-local datasets) and holocron doctor (to verify the configured dataset is reachable).

Terminal window
# CI — one org secret, inherited by every repo
export HOLOCRON_AXIOM_DATASET=holocron-ci
# Local — optional; leave unset to skip Axiom entirely
export HOLOCRON_AXIOM_DATASET=holocron-local

HOLOCRON_AXIOM_DATASET is not a secret.

providers: {
logs: "axiom",
}

No options are required. To pin the dataset that holocron doctor checks independent of the env var:

providers: {
logs: ["axiom", { dataset: "holocron-ci" }],
}
Option Required Description
dataset No Dataset name for whoami. Defaults to HOLOCRON_AXIOM_DATASET / AXIOM_DATASET
  1. Go to app.axiom.co/settings/api-tokens
  2. Create an API token with permission to read and create datasets
  3. Store it:
Terminal window
holocron auth set axiom <TOKEN>

Or via env var:

Terminal window
export HOLOCRON_AXIOM_TOKEN=<TOKEN>
# Also recognized:
export AXIOM_TOKEN=<TOKEN>
  • describe() — returns the provider name and required env var keys (HOLOCRON_AXIOM_TOKEN, HOLOCRON_AXIOM_DATASET)
  • whoami() — fetches the configured dataset to verify the token and its reachability
  • ensureDataset(name) — create the dataset if it does not exist; returns whether it already existed. Idempotent.
import { createPlugin } from "@theholocron/holocron-plugin-axiom";
const plugin = createPlugin({ token: process.env.HOLOCRON_AXIOM_TOKEN });
const logs = plugin.capabilities.logs();
const { alreadyExists } = await logs.ensureDataset("holocron-ci");
console.log(alreadyExists ? "dataset exists" : "dataset created");