Skip to content

Axiom Client

A TypeScript client for the Axiom API — wraps the dataset and current-user endpoints.

Terminal window
pnpm add @theholocron/axiom-client
import { createAxiomClient } from "@theholocron/axiom-client";
const client = createAxiomClient({
token: process.env.AXIOM_TOKEN!,
});
// Get the current token's user (token check)
const me = await client.user.me();
// Find or create a dataset
const dataset = await client.datasets.get("my-logs").catch(() => client.datasets.create({ name: "my-logs" }));
console.log(dataset.id);

The full API reference is generated from the package’s TSDoc comments.