@burn0/burn0 0.2.3 → 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.
- package/README.md +85 -81
- 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
|
|
57
|
+
import "@burn0/burn0"; // Must be first import
|
|
58
58
|
|
|
59
|
-
import express from
|
|
60
|
-
import OpenAI from
|
|
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
|
|
@@ -133,13 +150,13 @@ resend $0.15 ░░░░░░░░░░░░░░░░░░░
|
|
|
133
150
|
Know exactly which feature burns money:
|
|
134
151
|
|
|
135
152
|
```typescript
|
|
136
|
-
import { track } from
|
|
153
|
+
import { track } from "@burn0/burn0";
|
|
137
154
|
|
|
138
|
-
await track(
|
|
139
|
-
const profile = await ai.generateProfile(user)
|
|
140
|
-
await stripe.createSubscription(user.id)
|
|
141
|
-
await sendWelcomeEmail(user.email)
|
|
142
|
-
})
|
|
155
|
+
await track("onboarding", async () => {
|
|
156
|
+
const profile = await ai.generateProfile(user);
|
|
157
|
+
await stripe.createSubscription(user.id);
|
|
158
|
+
await sendWelcomeEmail(user.email);
|
|
159
|
+
});
|
|
143
160
|
```
|
|
144
161
|
|
|
145
162
|
```
|
|
@@ -159,55 +176,55 @@ burn0 auto-detects services from hostnames. Zero configuration.
|
|
|
159
176
|
|
|
160
177
|
### AI / LLMs
|
|
161
178
|
|
|
162
|
-
| Service
|
|
163
|
-
|
|
164
|
-
| OpenAI
|
|
165
|
-
| Anthropic
|
|
179
|
+
| Service | Detection | Pricing Model |
|
|
180
|
+
| ------------- | ----------------------------------- | ----------------- |
|
|
181
|
+
| OpenAI | `api.openai.com` | Per-token (exact) |
|
|
182
|
+
| Anthropic | `api.anthropic.com` | Per-token (exact) |
|
|
166
183
|
| Google Gemini | `generativelanguage.googleapis.com` | Per-token (exact) |
|
|
167
|
-
| Mistral
|
|
168
|
-
| Cohere
|
|
169
|
-
| Groq
|
|
170
|
-
| Together AI
|
|
171
|
-
| Perplexity
|
|
172
|
-
| DeepSeek
|
|
173
|
-
| Replicate
|
|
174
|
-
| Fireworks AI
|
|
175
|
-
| AI21 Labs
|
|
176
|
-
| Pinecone
|
|
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 |
|
|
177
194
|
|
|
178
195
|
### Pay-per-use APIs
|
|
179
196
|
|
|
180
|
-
| Service
|
|
181
|
-
|
|
182
|
-
| Stripe
|
|
183
|
-
| PayPal
|
|
184
|
-
| Plaid
|
|
185
|
-
| SendGrid
|
|
186
|
-
| Resend
|
|
187
|
-
| Twilio
|
|
188
|
-
| Vonage
|
|
189
|
-
| Algolia
|
|
190
|
-
| Google Maps | `maps.googleapis.com` | Per-request
|
|
191
|
-
| Mapbox
|
|
192
|
-
| Cloudinary
|
|
193
|
-
| Sentry
|
|
194
|
-
| Segment
|
|
195
|
-
| Mixpanel
|
|
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 |
|
|
196
213
|
|
|
197
214
|
### Databases & Infrastructure
|
|
198
215
|
|
|
199
|
-
| Service
|
|
200
|
-
|
|
201
|
-
| Supabase
|
|
202
|
-
| PlanetScale
|
|
203
|
-
| MongoDB Atlas | `*.mongodb.net`
|
|
204
|
-
| Upstash
|
|
205
|
-
| Neon
|
|
206
|
-
| Turso
|
|
207
|
-
| Firebase
|
|
208
|
-
| AWS S3
|
|
209
|
-
| AWS Lambda
|
|
210
|
-
| Vercel
|
|
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 |
|
|
211
228
|
|
|
212
229
|
**Unknown APIs are auto-tracked by request count.** Nothing slips through.
|
|
213
230
|
|
|
@@ -240,36 +257,23 @@ Your app starts
|
|
|
240
257
|
|
|
241
258
|
## Two Modes
|
|
242
259
|
|
|
243
|
-
| Mode
|
|
244
|
-
|
|
245
|
-
| **Local** (default) | No
|
|
246
|
-
| **Cloud** (opt-in)
|
|
247
|
-
|
|
248
|
-
### Cloud Dashboard
|
|
249
|
-
|
|
250
|
-
Connect an API key to see costs in the browser:
|
|
251
|
-
|
|
252
|
-
- **Live event feed** — every API call in real-time via SSE
|
|
253
|
-
- **Cost breakdown** — per service, per model, per day
|
|
254
|
-
- **Monthly projection** — estimated monthly spend based on trends
|
|
255
|
-
- **API key management** — create, list, revoke keys
|
|
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. |
|
|
256
264
|
|
|
257
|
-
|
|
258
|
-
# Sign in with GitHub at burn0.dev
|
|
259
|
-
# Create an API key, then:
|
|
260
|
-
npx burn0 connect
|
|
261
|
-
```
|
|
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)
|
|
262
266
|
|
|
263
267
|
---
|
|
264
268
|
|
|
265
269
|
## Configuration
|
|
266
270
|
|
|
267
|
-
| Env Variable
|
|
268
|
-
|
|
269
|
-
| `BURN0_API_KEY`
|
|
270
|
-
| `BURN0_API_URL`
|
|
271
|
-
| `BURN0_DEBUG`
|
|
272
|
-
| `BURN0_ENABLE_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` |
|
|
273
277
|
|
|
274
278
|
---
|
|
275
279
|
|
|
@@ -323,12 +327,12 @@ npm test
|
|
|
323
327
|
|
|
324
328
|
## Community
|
|
325
329
|
|
|
326
|
-
| Channel
|
|
327
|
-
|
|
328
|
-
| 🌐 Website | [burn0.dev](https://burn0.dev)
|
|
329
|
-
| 📖 Docs
|
|
330
|
-
| 🐦 Twitter | [@burn0dev](https://twitter.com/burn0dev)
|
|
331
|
-
| 💻 GitHub
|
|
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) |
|
|
332
336
|
|
|
333
337
|
---
|
|
334
338
|
|