Thanks to visit codestin.com
Credit goes to auralogger.com

Get started with Auralogger — install auralogger-cli, init, send logs, fetch logs

Install auralogger-cli (npm) or auralogger (pip), run init from your app directory, set AURALOGGER_PROJECT_TOKEN and AURALOGGER_USER_SECRET, send logs with Auralog/AuraLog, fetch with auralogger get-logs and JSON filters. End-to-end agentic logging setup for Node.js, Next.js, Vite, and Python.

Get started
One page: install -> init -> getting env values -> send logs -> fetch logs.

Install
- Python: pip install auralogger
- Node: npm install auralogger-cli (or yarn add / pnpm add / bun add)
- Verify CLI:
  - Python: auralogger --help
  - Node: npx auralogger-cli --help

Init
- Run from your app repo directory (the same folder that contains .env / .env.local).
- Python: auralogger init
- Node: npx auralogger-cli init
- Init prints dotenv lines plus helper snippets and prompts only for missing values.

Getting values
- Open Projects -> your project -> Setup guide in the app to copy env keys.
- Typical env lines:
  AURALOGGER_PROJECT_TOKEN="your-project-token"
  AURALOGGER_USER_SECRET="your-user-secret"
  AURALOGGER_PROJECT_SESSION="session-token-here"
  NEXT_PUBLIC_AURALOGGER_PROJECT_TOKEN="your-project-token"
  VITE_AURALOGGER_PROJECT_TOKEN="your-project-token"
- Keep AURALOGGER_USER_SECRET server-only; never ship it to browser bundles.

Send logs
- Non-encrypted mode and encrypted mode are both documented.
- Server helper uses project token; encrypted mode also uses AURALOGGER_USER_SECRET server-side.
- Browser helper uses only public project token.
- Node snippets include:
  src/lib/auralog/server-auralog.ts
  src/lib/auralog/client-auralog.ts
- Python snippet includes auralog.py.
- Usage examples show info / warn / error with optional location and metadata.

Fetch logs
- One invocation returns one page.
- Start with:
  auralogger get-logs -maxcount 20
  npx auralogger-cli get-logs -maxcount 20
- Filter examples:
  -type '["error","warn"]'
  -message '["timeout"]' -skip 20 -maxcount 30
  -time --since '["10m"]'
- maxcount is capped at 100 per page.

Get started

One page: install → init → getting env values → send logs → fetch logs.

Install

Run commands from the directory that contains your `.env` / `.env.local` (the CLI reads env from your current working directory).

pip install auralogger
auralogger --help

Init

Get private credentials from auralogger.com (or copy env keys from your project's Setup guide in the app), then run init in your app repo (where .env should live).

cd /path/to/your-app
auralogger init
Init prints dotenv lines plus ready-to-paste snippets, and only prompts for missing values.

Optional: use an agent prompt

If you are using coding agents, use the migration/setup prompt to skip most manual setup steps.

After init, you can hand off the rest of the setup or migration work to an agent with the copy-ready prompt on /docs/agent.

This is optional. It is useful when you want faster rollout across bigger codebases and want to avoid repetitive manual edits.

Getting values

The boring-but-correct pipeline — same beats `init` walks you through in the terminal.

Get env values from the project setup guide:

  1. Go to Projects (/projects).
  2. Click your project.
  3. Click the Setup guide button.
  4. Copy the env keys from the guide.

Run auralogger init — banner first, then prompts for whatever is missing. If the project token (AURALOGGER_PROJECT_TOKEN, NEXT_PUBLIC_AURALOGGER_PROJECT_TOKEN, or VITE_AURALOGGER_PROJECT_TOKEN), AURALOGGER_USER_SECRET, or AURALOGGER_PROJECT_SESSION is unset, the CLI prompts or fetches as needed.

After proj_auth, it shows the live session, the up-to-five-line dotenv block (token server + Next + Vite, user secret, session — each omitted if already in env), then two snippets (separate files): Auralog vs AuraLog.

Put private creds in server-side env (.env gitignored, host secret store, CI secrets). For AuraClient, use NEXT_PUBLIC_AURALOGGER_PROJECT_TOKEN or VITE_AURALOGGER_PROJECT_TOKEN (same ciphertext as the server token). Project id and styles need not live in .env; SDKs and get-logs can pull them from proj_auth when needed (styles affect get-logs terminal output, not local SDK success logging).

Typical .env fragment (Next + Vite token lines are for bundlers; keep user secret off the client):

# PRIVATE — never expose to browser bundles or public repos
AURALOGGER_PROJECT_TOKEN="your-project-token"
AURALOGGER_USER_SECRET="your-user-secret"
AURALOGGER_PROJECT_SESSION="session-token-here"
NEXT_PUBLIC_AURALOGGER_PROJECT_TOKEN="your-project-token"
VITE_AURALOGGER_PROJECT_TOKEN="your-project-token"

Send logs

Use Non-encrypted vs Encrypted for the server helper: encrypted mode uses AURALOGGER_USER_SECRET on the server. The browser helper still uses only the public project token (never the user secret). Match your project (see Setup guide in the app).

import os
from typing import Any, Dict, Literal, Optional
from auralogger import Auralogger
_configured = False
def _ensure_configured() -> None:
global _configured
if _configured:
return
project_token = os.environ.get("AURALOGGER_PROJECT_TOKEN", "").strip()
# Non-encrypted: project token from env (no user secret in this path).
Auralogger.configure(project_token)
_configured = True
def auralog(
type: Literal["debug", "info", "warn", "error"],
message: str,
location: Optional[str] = None,
data: Optional[Dict[str, Any]] = None,
) -> None:
_ensure_configured()
Auralogger.log(type, message, location, data)

Use it from your application code (after importing your `auralog` helper):

from auralog import auralog
auralog("info", "new client tests", "src/app/test/page.tsx", {"source": "test-page-client"})
# expected: [info] new client tests @ src/app/test/page.tsx { source: "test-page-client" }
auralog("warn", "client cache miss")
# expected: [warn] client cache miss
auralog("error", "client fetch failed", None, {"retrying": True})
# expected: [error] client fetch failed { retrying: True }

Fetch logs

Each run fetches one page of logs. Use maxcount (cap 100) and skip to page across results.

auralogger get-logs -maxcount 20
auralogger get-logs -type '["error","warn"]' -maxcount 50
auralogger get-logs -message '["timeout"]' -skip 20 -maxcount 30
auralogger get-logs -type --not-in '["info","debug"]' -time --since '["10m"]'