{"_id":"@brime-ai/brime","_rev":"2-35ceb37ee856b3a6ddbf36634ebe62e6","name":"@brime-ai/brime","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@brime-ai/brime","version":"0.1.0","keywords":["brime","search","extract","research","rag","llm","agents","ai","sdk"],"author":{"name":"Brime"},"license":"MIT","_id":"@brime-ai/brime@0.1.0","maintainers":[{"name":"brime-ai","email":"saitturanalp.34@gmail.com"}],"homepage":"https://brime.dev","bugs":{"url":"https://github.com/brime-dev/brime-node/issues"},"dist":{"shasum":"544fe2b4af6f9157b0a02ddecda501b2827b8baf","tarball":"https://registry.npmjs.org/@brime-ai/brime/-/brime-0.1.0.tgz","fileCount":10,"integrity":"sha512-eEoMRTdvxdt3hGpmmLRQieRuXl/NHi8dgFCF+ifxqKv393OsuneFq8dwj/rVopaHsaTdrL4slplgLE29okpqbQ==","signatures":[{"sig":"MEQCIC20qI8ZUAaB0Jf36e0G5fvH/zqMXUB0cMOdWXNwHBTqAiAeM6PAI2/6VMIUSb/5TjC0loDsdZx3ifuR1QvbNa2nSQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":123942},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"c97d6554b2117d1ed4e33166654ddc2506820129","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:live":"vitest run tests/e2e","test:unit":"vitest run tests/unit","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"brime-ai","email":"saitturanalp.34@gmail.com"},"repository":{"url":"git+https://github.com/brime-dev/brime-node.git","type":"git"},"_npmVersion":"10.9.4","description":"Official Node.js / TypeScript SDK for the Brime API (search · extract · research)","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"~8.3.0","vitest":"~2.1.0","typescript":"~5.5.0","@types/node":"~20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/brime_0.1.0_1779359431602_0.8680040176031358","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@brime-ai/brime","version":"0.2.0","description":"Official Node.js / TypeScript SDK for the Brime API (search · extract · research)","license":"MIT","author":{"name":"Brime"},"homepage":"https://brime.dev","repository":{"type":"git","url":"git+https://github.com/brime-dev/brime-node.git"},"bugs":{"url":"https://github.com/brime-dev/brime-node/issues"},"keywords":["brime","search","extract","research","rag","llm","agents","ai","sdk"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"sideEffects":false,"engines":{"node":">=18.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:unit":"vitest run tests/unit","test:live":"vitest run tests/e2e","lint:types":"attw --pack .","lint:publish":"publint","lint:pkg":"npm run lint:publish","prepublishOnly":"npm run build && npm run lint:pkg"},"devDependencies":{"@arethetypeswrong/cli":"^0.18.2","@types/node":"~20.11.0","publint":"^0.3.0","tsup":"~8.3.0","typescript":"~5.5.0","vitest":"~2.1.0"},"publishConfig":{"access":"public","provenance":true},"_id":"@brime-ai/brime@0.2.0","gitHead":"8c80efdd75b2df44cde5622ec43536eb45876c37","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-bU+8Elk9W943Qqj8dI+6lShTGJdMSPIU8atrF03G5qleHekCVcohotBrBUK+ymjiAXLrYFDYKD2M6ymDGjvtvA==","shasum":"7df340a7819d4924f5a065b2cd7ea35bb58805c2","tarball":"https://registry.npmjs.org/@brime-ai/brime/-/brime-0.2.0.tgz","fileCount":8,"unpackedSize":57007,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeBCGxIMzJpOzW1ZjACGEjppSi0h1r1FmcCvC5KAej+QIhANq6xKW8y5iP5MNnofnVt5ZZGptVm6t39V+LZQDP+/wE"}]},"_npmUser":{"name":"brime-ai","email":"saitturanalp.34@gmail.com"},"directories":{},"maintainers":[{"name":"brime-ai","email":"saitturanalp.34@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brime_0.2.0_1779378577208_0.7283082464003618"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-21T10:30:31.428Z","modified":"2026-05-21T15:49:37.454Z","0.1.0":"2026-05-21T10:30:31.754Z","0.2.0":"2026-05-21T15:49:37.359Z"},"bugs":{"url":"https://github.com/brime-dev/brime-node/issues"},"author":{"name":"Brime"},"license":"MIT","homepage":"https://brime.dev","keywords":["brime","search","extract","research","rag","llm","agents","ai","sdk"],"repository":{"type":"git","url":"git+https://github.com/brime-dev/brime-node.git"},"description":"Official Node.js / TypeScript SDK for the Brime API (search · extract · research)","maintainers":[{"name":"brime-ai","email":"saitturanalp.34@gmail.com"}],"readme":"# @brime-ai/brime\n\n[![npm](https://img.shields.io/npm/v/@brime-ai/brime.svg?logo=npm)](https://www.npmjs.com/package/@brime-ai/brime)\n[![types](https://img.shields.io/npm/types/@brime-ai/brime.svg?logo=typescript)](./dist/index.d.ts)\n[![provenance](https://img.shields.io/badge/provenance-attested-2ea44f?logo=github)](https://docs.npmjs.com/generating-provenance-statements/)\n[![MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)\n\n**The live-web toolkit for AI apps.** One API key. One SDK. Search, scrape, and research the open web — clean output, sane defaults, no plumbing.\n\n**[Documentation](https://docs.brime.dev/sdks/nodejs)** | **[Get Your API Key](https://platform.brime.dev/keys)** | **[Changelog](./CHANGELOG.md)** | **[GitHub](https://github.com/brime-dev/brime-node)**\n\n```bash\nnpm install @brime-ai/brime\n```\n\nBuilt for Node.js 18+, Bun, Deno, Cloudflare Workers, and modern browsers. Native `fetch`, zero HTTP dependencies, ESM + CJS + full TypeScript types. Every release ships with [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) provenance.\n\n## Why brime?\n\n- **One key, three primitives.** `search`, `extract`, `research` — the shape every AI app needs from the web.\n- **Tuned defaults.** No depth selectors, no round counters, no knobs to babysit. The gateway is tuned for you; you pass a query, you get a clean answer.\n- **Drop-in compatible.** If you're already on Tavily, Exa, or Parallel, point their SDK at our adapter URL and your code keeps working. Migrate when you're ready.\n- **Honest pricing.** Flat per-call credits. 0.5 for search, 1 per URL for extract, 5 for research. No surprises.\n\n## 30 seconds\n\n```ts\nimport { Brime } from \"@brime-ai/brime\";\n\nconst brime = new Brime(); // reads BRIME_API_KEY\n\n// Live answer + ranked sources, sub-second.\nconst { answer, results } = await brime.search({\n  query: \"what changed in the latest TypeScript release\",\n});\nconsole.log(answer);\n```\n\nThat's the whole shape. Same pattern for `extract` and `research`.\n\n## What you can build\n\n### Search the open web\n\n```ts\nconst { answer, results } = await brime.search({\n  query: \"tesla earnings\", // any natural-language query\n  topic: \"finance\",        // optional: news / general / finance recency hint\n  time_range: \"week\",      // optional: day / week / month / year\n  domains: [\"sec.gov\"],    // optional allow-list\n});\n```\n\n### Turn any URL into clean markdown\n\n```ts\nconst { results, failed } = await brime.extract({\n  urls: [\"https://example.com\", \"https://en.wikipedia.org/wiki/BM25\"],\n});\n\nfor (const r of results) console.log(r.url, r.markdown.length);\nfor (const f of failed) console.warn(\"skipped\", f.url, f.error.message);\n```\n\nHandles HTML, PDF, DOCX, and JavaScript-heavy SPAs. Smart-clean pipeline strips chrome, nav, cookie banners, and template noise — what's left is the article.\n\n### Multi-step research with citations\n\n```ts\nconst { answer, sources } = await brime.research({\n  query: \"compare frontier coding models with concrete benchmark numbers\",\n});\n\nconsole.log(answer);\nconsole.log(`${sources.length} sources cited`);\n```\n\nOne call, ~30–90 seconds, real synthesis from real sources. Want live progress? Stream it:\n\n```ts\nfor await (const evt of brime.researchStream({ query: \"...\" })) {\n  console.log(evt.event, evt.data);\n  if (evt.event === \"complete\" || evt.event === \"error\") break;\n}\n```\n\n## Authentication\n\n```bash\nexport BRIME_API_KEY=\"sk-brime-...\"\n```\n\n```ts\nnew Brime();                            // uses BRIME_API_KEY\nnew Brime({ apiKey: \"sk-brime-...\" });  // explicit\nnew Brime({ baseUrl: \"https://...\" });  // staging override (or BRIME_BASE_URL)\n```\n\nGet a key at [brime.dev](https://brime.dev) — the free tier comes with 1,000 credits/month and no card.\n\n## TypeScript\n\nEverything is typed end-to-end:\n\n```ts\nimport type {\n  SearchResponse,\n  ExtractResponse,\n  ResearchBasicResponse,\n  ResearchSseEvent,\n} from \"@brime-ai/brime\";\n```\n\n## Error handling\n\nTyped exceptions, predictable surface area:\n\n```ts\nimport {\n  AuthenticationError,\n  RateLimitError,\n  InsufficientCreditsError,\n  BrimeError,\n} from \"@brime-ai/brime\";\n\ntry {\n  await brime.search({ query: \"...\" });\n} catch (e) {\n  if (e instanceof AuthenticationError) /* bad key */;\n  else if (e instanceof RateLimitError) /* back off */;\n  else if (e instanceof InsufficientCreditsError) /* top up */;\n  else if (e instanceof BrimeError) console.error(e.code, e.message);\n  else throw e;\n}\n```\n\n## Idempotency, baked in\n\n`extract` calls require an `Idempotency-Key` — the SDK auto-generates one per call so accidental retries never double-charge. Pin it yourself for cross-process dedup:\n\n```ts\nawait brime.extract(\n  { urls: [\"https://x\"] },\n  { idempotencyKey: \"user-42-prefetch-2026-05\" },\n);\n```\n\n## Configuration\n\n| Constructor option | Env var          | Default                  |\n|--------------------|------------------|--------------------------|\n| `apiKey`           | `BRIME_API_KEY`  | — (required)             |\n| `baseUrl`          | `BRIME_BASE_URL` | `https://api.brime.dev`  |\n| `timeout`          | —                | `30_000` ms              |\n\n## Already using Tavily, Exa, or Parallel?\n\nYou don't have to rip them out. Brime exposes wire-compatible adapters:\n\n```ts\nnew TavilyClient({ apiKey, apiBaseUrl: \"https://api.brime.dev/tavily\" });\nnew Exa(apiKey, { baseUrl: \"https://api.brime.dev/exa\" });\nnew Parallel({ apiKey, baseUrl: \"https://api.brime.dev/parallel\" });\n```\n\nSame response shapes, same code. Switch to the native `brime` SDK when you want the extras (research synthesis, SSE streaming, smart-clean extract).\n\n## Links\n\n- Docs — [docs.brime.dev](https://docs.brime.dev)\n- API reference — [docs.brime.dev/api-reference](https://docs.brime.dev/api-reference)\n- Status — [brime.dev](https://brime.dev)\n- Issues — [github.com/brime-dev/brime-node/issues](https://github.com/brime-dev/brime-node/issues)\n\n## License\n\nMIT © Brime\n","readmeFilename":"README.md"}