Skip to content

1focus-ai/1focus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1Focus

All inclusive toolkit to build complex apps

Setup

Install task. Then run task setup & follow instructions until it says ✔️ you are setup.

Commands

Run task to see all possible commands.

Usage

1focus ships an ergonomic logging helper that wraps @axiomhq/js so you can ship events to Axiom from Node or browser code.

import { log } from "1focus"

await log("hello world")
await log("user signed in", { userId: "123" })

Need more control? Create a scoped logger that bundles defaults and context:

import { createLogger } from "1focus"

const logger = createLogger({
  metadata: { service: "api" },
  flush: true,
})

await logger.info("order placed", { orderId: "ord_123", value: 42.5 })
await logger.error(new Error("checkout failed"), { orderId: "ord_123" })

const requestLogger = logger.with({ requestId: "req_abc" })
await requestLogger.debug("db.query", { durationMs: 32 })

Configuration

Set the following environment variables (or supply overrides when calling log):

  • AXIOM_TOKEN – API token with ingest permissions.
  • AXIOM_DATASET – Dataset name to receive the events.
  • AXIOM_ORG_ID (optional) – Only required when using personal tokens.
  • AXIOM_URL (optional) – Set when using a self-hosted Axiom instance.

For front-end apps built with Vite, use the VITE_ prefixed variants (e.g. VITE_AXIOM_TOKEN).

Contributing

Any PR to improve is welcome. codex & cursor are nice for dev. Great working & useful patches are most appreciated (ideally). Issues with bugs or ideas are welcome too.

About

Toolkit to build complex apps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published