@burn0/burn0 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +84 -116
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -54,10 +54,10 @@ npm i @burn0/burn0
54
54
  Add one line to your entry file:
55
55
 
56
56
  ```typescript
57
- import '@burn0/burn0' // Must be first import
57
+ import "@burn0/burn0"; // Must be first import
58
58
 
59
- import express from 'express'
60
- import OpenAI from 'openai'
59
+ import express from "express";
60
+ import OpenAI from "openai";
61
61
  // ... your app runs exactly the same
62
62
  ```
63
63
 
@@ -73,6 +73,23 @@ On exit:
73
73
  burn0 ▸ session: $0.47 (12 calls, 4m 22s) ── today: $14.32 ── ~$430/mo
74
74
  ```
75
75
 
76
+ ### Want full history and dashboards? Add an API key:
77
+
78
+ ```bash
79
+ # 1. Sign in with GitHub and create a key
80
+ open https://burn0.dev/login
81
+ # → Dashboard → API Keys → Create Key
82
+
83
+ # 2. Add it to your project
84
+ echo 'BURN0_API_KEY=b0_sk_your_key_here' >> .env
85
+
86
+ # 3. Restart — costs now sync to burn0.dev
87
+ ```
88
+
89
+ Now you get a **live event feed**, **cost breakdown by service**, **monthly projections**, and **full request history** — all at [burn0.dev/dashboard](https://burn0.dev/dashboard).
90
+
91
+ > burn0 only syncs metadata (service, model, tokens, cost, latency) — never request/response bodies or your API keys.
92
+
76
93
  ---
77
94
 
78
95
  ## How It Compares
@@ -128,67 +145,18 @@ resend $0.15 ░░░░░░░░░░░░░░░░░░░
128
145
 
129
146
  ---
130
147
 
131
- ## Dashboard — See Everything in One Place
132
-
133
- The terminal is great for development. But when you want history, trends, and team visibility — connect to the **free dashboard** at [burn0.dev](https://burn0.dev).
134
-
135
- ### Get started in 60 seconds:
136
-
137
- ```bash
138
- # 1. Sign in with GitHub
139
- open https://burn0.dev/login
140
-
141
- # 2. Go to your dashboard and copy your API key
142
- # Dashboard → API Keys → Create Key
143
-
144
- # 3. Add the key to your project
145
- echo 'BURN0_API_KEY=b0_sk_your_key_here' >> .env
146
-
147
- # 4. Restart your app — costs now sync to the dashboard
148
- npm run dev
149
- ```
150
-
151
- That's it. Every API call is now tracked in the dashboard.
152
-
153
- ### What you'll see:
154
-
155
- | Feature | Description |
156
- |---|---|
157
- | **Live Event Feed** | Every API call streams in real-time — service, model, tokens, cost, latency |
158
- | **Cost Breakdown** | Per-service, per-model cost breakdown with visual charts |
159
- | **Monthly Projection** | Estimated monthly spend based on your actual usage trends |
160
- | **Request History** | Full history of every tracked API call, searchable and filterable |
161
- | **API Key Management** | Create, list, and revoke keys from the dashboard |
162
-
163
- ### How it works:
164
-
165
- ```
166
- Your app (with BURN0_API_KEY set)
167
-
168
- ├─ Costs still appear in your terminal (nothing changes)
169
-
170
- └─ Events also sync to burn0.dev ──→ Dashboard
171
-
172
- ├─ Only metadata: service, model, tokens, cost, status, latency
173
- └─ Never request/response bodies. Never your API keys.
174
- ```
175
-
176
- > **Privacy**: burn0 never reads your request or response content. Only metadata is synced — service name, model, token counts, cost, status code, and latency. Your API keys and data stay on your machine.
177
-
178
- ---
179
-
180
148
  ## Feature Attribution
181
149
 
182
150
  Know exactly which feature burns money:
183
151
 
184
152
  ```typescript
185
- import { track } from '@burn0/burn0'
153
+ import { track } from "@burn0/burn0";
186
154
 
187
- await track('onboarding', async () => {
188
- const profile = await ai.generateProfile(user)
189
- await stripe.createSubscription(user.id)
190
- await sendWelcomeEmail(user.email)
191
- })
155
+ await track("onboarding", async () => {
156
+ const profile = await ai.generateProfile(user);
157
+ await stripe.createSubscription(user.id);
158
+ await sendWelcomeEmail(user.email);
159
+ });
192
160
  ```
193
161
 
194
162
  ```
@@ -208,55 +176,55 @@ burn0 auto-detects services from hostnames. Zero configuration.
208
176
 
209
177
  ### AI / LLMs
210
178
 
211
- | Service | Detection | Pricing Model |
212
- |---|---|---|
213
- | OpenAI | `api.openai.com` | Per-token (exact) |
214
- | Anthropic | `api.anthropic.com` | Per-token (exact) |
179
+ | Service | Detection | Pricing Model |
180
+ | ------------- | ----------------------------------- | ----------------- |
181
+ | OpenAI | `api.openai.com` | Per-token (exact) |
182
+ | Anthropic | `api.anthropic.com` | Per-token (exact) |
215
183
  | Google Gemini | `generativelanguage.googleapis.com` | Per-token (exact) |
216
- | Mistral | `api.mistral.ai` | Per-token (exact) |
217
- | Cohere | `api.cohere.ai` | Per-token |
218
- | Groq | `api.groq.com` | Per-token |
219
- | Together AI | `api.together.xyz` | Per-token |
220
- | Perplexity | `api.perplexity.ai` | Per-token |
221
- | DeepSeek | `api.deepseek.com` | Per-token |
222
- | Replicate | `api.replicate.com` | Per-second |
223
- | Fireworks AI | `api.fireworks.ai` | Per-token |
224
- | AI21 Labs | `api.ai21.com` | Per-token |
225
- | Pinecone | `*.pinecone.io` | Per-request |
184
+ | Mistral | `api.mistral.ai` | Per-token (exact) |
185
+ | Cohere | `api.cohere.ai` | Per-token |
186
+ | Groq | `api.groq.com` | Per-token |
187
+ | Together AI | `api.together.xyz` | Per-token |
188
+ | Perplexity | `api.perplexity.ai` | Per-token |
189
+ | DeepSeek | `api.deepseek.com` | Per-token |
190
+ | Replicate | `api.replicate.com` | Per-second |
191
+ | Fireworks AI | `api.fireworks.ai` | Per-token |
192
+ | AI21 Labs | `api.ai21.com` | Per-token |
193
+ | Pinecone | `*.pinecone.io` | Per-request |
226
194
 
227
195
  ### Pay-per-use APIs
228
196
 
229
- | Service | Detection | Pricing Model |
230
- |---|---|---|
231
- | Stripe | `api.stripe.com` | Per-transaction |
232
- | PayPal | `api.paypal.com` | Per-transaction |
233
- | Plaid | `*.plaid.com` | Per-request |
234
- | SendGrid | `api.sendgrid.com` | Per-email |
235
- | Resend | `api.resend.com` | Per-email |
236
- | Twilio | `api.twilio.com` | Per-message |
237
- | Vonage | `api.nexmo.com` | Per-message |
238
- | Algolia | `*.algolia.net` | Per-search |
239
- | Google Maps | `maps.googleapis.com` | Per-request |
240
- | Mapbox | `api.mapbox.com` | Per-request |
241
- | Cloudinary | `api.cloudinary.com` | Per-transform |
242
- | Sentry | `sentry.io` | Per-event |
243
- | Segment | `api.segment.io` | Per-event |
244
- | Mixpanel | `api.mixpanel.com` | Per-event |
197
+ | Service | Detection | Pricing Model |
198
+ | ----------- | --------------------- | --------------- |
199
+ | Stripe | `api.stripe.com` | Per-transaction |
200
+ | PayPal | `api.paypal.com` | Per-transaction |
201
+ | Plaid | `*.plaid.com` | Per-request |
202
+ | SendGrid | `api.sendgrid.com` | Per-email |
203
+ | Resend | `api.resend.com` | Per-email |
204
+ | Twilio | `api.twilio.com` | Per-message |
205
+ | Vonage | `api.nexmo.com` | Per-message |
206
+ | Algolia | `*.algolia.net` | Per-search |
207
+ | Google Maps | `maps.googleapis.com` | Per-request |
208
+ | Mapbox | `api.mapbox.com` | Per-request |
209
+ | Cloudinary | `api.cloudinary.com` | Per-transform |
210
+ | Sentry | `sentry.io` | Per-event |
211
+ | Segment | `api.segment.io` | Per-event |
212
+ | Mixpanel | `api.mixpanel.com` | Per-event |
245
213
 
246
214
  ### Databases & Infrastructure
247
215
 
248
- | Service | Detection | Pricing Model |
249
- |---|---|---|
250
- | Supabase | `*.supabase.co` | Per-request |
251
- | PlanetScale | `*.psdb.cloud` | Per-request |
252
- | MongoDB Atlas | `*.mongodb.net` | Per-request |
253
- | Upstash | `*.upstash.io` | Per-request |
254
- | Neon | `*.neon.tech` | Per-request |
255
- | Turso | `*.turso.io` | Per-request |
256
- | Firebase | `*.firebaseio.com` | Per-request |
257
- | AWS S3 | `*.s3.amazonaws.com` | Per-request |
258
- | AWS Lambda | `lambda.*.amazonaws.com` | Per-invocation |
259
- | Vercel | `api.vercel.com` | Per-request |
216
+ | Service | Detection | Pricing Model |
217
+ | ------------- | ------------------------ | -------------- |
218
+ | Supabase | `*.supabase.co` | Per-request |
219
+ | PlanetScale | `*.psdb.cloud` | Per-request |
220
+ | MongoDB Atlas | `*.mongodb.net` | Per-request |
221
+ | Upstash | `*.upstash.io` | Per-request |
222
+ | Neon | `*.neon.tech` | Per-request |
223
+ | Turso | `*.turso.io` | Per-request |
224
+ | Firebase | `*.firebaseio.com` | Per-request |
225
+ | AWS S3 | `*.s3.amazonaws.com` | Per-request |
226
+ | AWS Lambda | `lambda.*.amazonaws.com` | Per-invocation |
227
+ | Vercel | `api.vercel.com` | Per-request |
260
228
 
261
229
  **Unknown APIs are auto-tracked by request count.** Nothing slips through.
262
230
 
@@ -289,10 +257,10 @@ Your app starts
289
257
 
290
258
  ## Two Modes
291
259
 
292
- | Mode | API Key | What happens |
293
- |---|---|---|
294
- | **Local** (default) | No | Costs in terminal + local ledger. Zero network calls to burn0. |
295
- | **Cloud** (opt-in) | Yes | Same as local + events sync to [dashboard](https://burn0.dev/dashboard) for full history and team visibility. |
260
+ | Mode | API Key | What happens |
261
+ | ------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
262
+ | **Local** (default) | No | Costs in terminal + local ledger. Zero network calls to burn0. |
263
+ | **Cloud** (opt-in) | Yes | Same as local + events sync to [dashboard](https://burn0.dev/dashboard) for full history and team visibility. |
296
264
 
297
265
  > **Start local, upgrade when ready.** burn0 works perfectly without an API key. When you want history and dashboards, add a key — it takes 60 seconds. [Get your free API key →](https://burn0.dev/login)
298
266
 
@@ -300,12 +268,12 @@ Your app starts
300
268
 
301
269
  ## Configuration
302
270
 
303
- | Env Variable | Default | Description |
304
- |---|---|---|
305
- | `BURN0_API_KEY` | — | API key for cloud mode |
306
- | `BURN0_API_URL` | `https://api.burn0.dev` | Backend URL |
307
- | `BURN0_DEBUG` | `false` | Enable debug logging |
308
- | `BURN0_ENABLE_TEST` | — | Set to `1` to enable in `NODE_ENV=test` |
271
+ | Env Variable | Default | Description |
272
+ | ------------------- | ----------------------- | --------------------------------------- |
273
+ | `BURN0_API_KEY` | — | API key for cloud mode |
274
+ | `BURN0_API_URL` | `https://api.burn0.dev` | Backend URL |
275
+ | `BURN0_DEBUG` | `false` | Enable debug logging |
276
+ | `BURN0_ENABLE_TEST` | — | Set to `1` to enable in `NODE_ENV=test` |
309
277
 
310
278
  ---
311
279
 
@@ -359,12 +327,12 @@ npm test
359
327
 
360
328
  ## Community
361
329
 
362
- | Channel | Link |
363
- |---|---|
364
- | 🌐 Website | [burn0.dev](https://burn0.dev) |
365
- | 📖 Docs | [docs.burn0.dev](https://docs.burn0.dev) |
366
- | 🐦 Twitter | [@burn0dev](https://twitter.com/burn0dev) |
367
- | 💻 GitHub | [burn0-dev/burn0](https://github.com/burn0-dev/burn0) |
330
+ | Channel | Link |
331
+ | ---------- | ----------------------------------------------------- |
332
+ | 🌐 Website | [burn0.dev](https://burn0.dev) |
333
+ | 📖 Docs | [docs.burn0.dev](https://docs.burn0.dev) |
334
+ | 🐦 Twitter | [@burn0dev](https://twitter.com/burn0dev) |
335
+ | 💻 GitHub | [burn0-dev/burn0](https://github.com/burn0-dev/burn0) |
368
336
 
369
337
  ---
370
338
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burn0/burn0",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Lightweight cost observability for every API call in your stack",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",