{"_id":"@adtention/sdk","_rev":"6-411cfb913011dd013f789eafad48abfa","name":"@adtention/sdk","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@adtention/sdk","version":"0.1.0","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"author":{"name":"ADtention"},"license":"MIT","_id":"@adtention/sdk@0.1.0","maintainers":[{"name":"moonman421","email":"team@adtention.ai"}],"homepage":"https://github.com/adtention-ai/sdk-js#readme","bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"dist":{"shasum":"bb205c7d07bf895d264ed8e465b8d8c12df92673","tarball":"https://registry.npmjs.org/@adtention/sdk/-/sdk-0.1.0.tgz","fileCount":13,"integrity":"sha512-CqDvKcG2JuQ8UwVNXtfod6nDinOhGvPnFCPH+ktse91yzid+S6C007uKwMtj2TbXRI67ogTIAIB56Z47ulatEw==","signatures":[{"sig":"MEQCIAwoVDVqaDEOcHo9c666d24R8U9BJd8pkdj53AaeshVcAiBQDx0/E9LjGkfdgSjszRkv3A/q8M3h6MJEPiPx5c9+BA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74093},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"gitHead":"eab4dacf0ef5d0b6e02b69d0c530b48ea4b88b1a","scripts":{"test":"npm run build && node --test test/","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"moonman421","email":"team@adtention.ai"},"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.0","@types/node":"^20.19.43"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1781722863971_0.834439832916547","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@adtention/sdk","version":"0.1.1","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"author":{"name":"ADtention"},"license":"MIT","_id":"@adtention/sdk@0.1.1","maintainers":[{"name":"moonman421","email":"team@adtention.ai"}],"homepage":"https://github.com/adtention-ai/sdk-js#readme","bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"dist":{"shasum":"27a03d8731d9905c16b63f091fecee5300d2a51f","tarball":"https://registry.npmjs.org/@adtention/sdk/-/sdk-0.1.1.tgz","fileCount":13,"integrity":"sha512-wu2oVbbsMtFAs+HXWURj0duRLy6wBhPKTVkbMsA+Qx2ZLO0pILJxouXmSa0UzTvFZOPrqWSDMYjdfSDqqmH3BQ==","signatures":[{"sig":"MEQCIDTwXyWgOG9spj0w62jzCPiwLK4LsgyPCCFYJEoQSBLuAiAwKxXLecHXLMOSSNDs3OthVHKvTd1YhpMmqqj0LyJFXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74115},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"gitHead":"b8b021c2cc83f2bae1578fa22c4d6d0110ea33c2","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"moonman421","email":"team@adtention.ai"},"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.0","@types/node":"^20.19.43"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1781723573681_0.44571504732289746","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@adtention/sdk","version":"0.2.0","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"author":{"name":"ADtention"},"license":"MIT","_id":"@adtention/sdk@0.2.0","maintainers":[{"name":"moonman421","email":"team@adtention.ai"}],"homepage":"https://github.com/adtention-ai/sdk-js#readme","bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"dist":{"shasum":"e52715a30467edbcaee6beaf0779e2a792015ace","tarball":"https://registry.npmjs.org/@adtention/sdk/-/sdk-0.2.0.tgz","fileCount":13,"integrity":"sha512-hh8W95seWHhpal6z8Rb6WpdrbpJccak9k3ScX3xDyBHFNJu0kRlf3Vw/8u3XDaM1bhkuyFkcoF/tY31DVD2jcw==","signatures":[{"sig":"MEQCIHe0w7hZpYKvffxQyrPki88M9Gvq5v/TewuwXsQEu3wgAiAjL4pYk7OlAc0LPO7r8vH1t6H+vhYi4JbiGVFff/POJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73829},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"gitHead":"6c95c474629a0bad4d8ea6addc994aef87925f22","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"moonman421","email":"team@adtention.ai"},"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.0","@types/node":"^20.19.43"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.0_1781772250640_0.041370497206614454","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@adtention/sdk","version":"0.3.0","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"author":{"name":"ADtention"},"license":"MIT","_id":"@adtention/sdk@0.3.0","maintainers":[{"name":"moonman421","email":"team@adtention.ai"}],"homepage":"https://github.com/adtention-ai/sdk-js#readme","bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"dist":{"shasum":"1a5927c2f9fd2c8023e4e896c34d2f46cbb5459c","tarball":"https://registry.npmjs.org/@adtention/sdk/-/sdk-0.3.0.tgz","fileCount":13,"integrity":"sha512-3nkIwpk9aTdTxYWGdvzP8N0diebbDkvfoKL1jDqFivWGslDfxisbhnGcAhySwnUhZJdx0EBVWMWk5tytWljEzA==","signatures":[{"sig":"MEYCIQCWkFLCoyZhMpKTKgaTLnIgWcPMmbntvH7TY2hP2Vu/LwIhAK/cPxOBu35Ql8UsWB55amz8z7+EjnWfJfDAsubjVksx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79104},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"gitHead":"3a730a40a2e622e253f7e40f1640ed6e895ebf7e","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"moonman421","email":"team@adtention.ai"},"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.0","@types/node":"^20.19.43"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.3.0_1782229540532_0.7997971377882092","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@adtention/sdk","version":"0.4.0","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"author":{"name":"ADtention"},"license":"MIT","_id":"@adtention/sdk@0.4.0","maintainers":[{"name":"moonman421","email":"team@adtention.ai"}],"homepage":"https://github.com/adtention-ai/sdk-js#readme","bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"dist":{"shasum":"14793afafe2a6a2f3cf66af27da62ca22a195c54","tarball":"https://registry.npmjs.org/@adtention/sdk/-/sdk-0.4.0.tgz","fileCount":13,"integrity":"sha512-9QEvrQxa9yCatL4d65LNy3i16qeG5C0AITuqcuBsq/83kZmIlMW67tze8MEIWUjPP9eaCdnCK7ueoBgP077sIw==","signatures":[{"sig":"MEYCIQCDSUuLtbNxS/dxN8PVoJnXOdj27iZiTeSh+DY+GC1TGwIhAMU7woo7+3U4OisQ4u3hH5BevM+3jNuZWD9vDTT8snWJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77809},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"gitHead":"446242acf671bf07585aa00c1703b423f9ba0027","scripts":{"test":"npm run build && node --test test/*.test.mjs","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"moonman421","email":"team@adtention.ai"},"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.6.0","@types/node":"^20.19.43"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.4.0_1782764093894_0.5086219535192418","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-17T19:01:03.762Z","modified":"2026-06-30T16:52:53.691Z","0.1.0":"2026-06-17T19:01:04.119Z","0.1.1":"2026-06-17T19:12:53.824Z","0.2.0":"2026-06-18T08:44:10.780Z","0.3.0":"2026-06-23T15:45:40.680Z","0.4.0":"2026-06-29T20:14:54.061Z"},"bugs":{"url":"https://github.com/adtention-ai/sdk-js/issues"},"author":{"name":"ADtention"},"license":"MIT","homepage":"https://github.com/adtention-ai/sdk-js#readme","keywords":["adtention","ads","sdk","developer-tools","status-line","revshare"],"repository":{"url":"git+https://github.com/adtention-ai/sdk-js.git","type":"git"},"description":"Publisher SDK for ADtention — show one sponsored line in your app's wait states and earn a revshare. Terminal-safe, idempotent, multi-tenant.","maintainers":[{"email":"team@adtention.ai","name":"moonman421"},{"email":"jp@adtention.ai","name":"jpche"}],"readme":"# @adtention/sdk\n\nPublisher SDK for [ADtention](https://adtention.ai/integrate). Show **one sponsored line** in your app's\nwait states (a coding-agent status line, a CLI spinner, a terminal idle moment) and earn a\nrevshare. The sponsored line is plain text. Only a category tag and an opaque per-user token ever leave your\nprocess.\n\n- **Terminal-safe.** Sponsor text is stripped of ANSI and control bytes before you ever see it.\n  No escape injection, no log injection.\n- **Idempotent.** Every serve carries a nonce, so retries never double-count.\n- **Multi-tenant.** One publisher account, many end users, each rate-limited independently.\n- **Universal.** The core uses only `fetch` and Web Crypto, so it runs on Node 20+, Cloudflare\n  Workers, Deno, Bun, and browsers. A file-backed identity store for Node lives at\n  `@adtention/sdk/node`.\n\n```bash\nnpm install @adtention/sdk\n```\n\n## Two ways to earn\n\nYou choose who collects the revshare:\n\n- **You keep it (default).** Your project holds one `publisher_id`, and every sponsored line shown across all\n  your users credits that one account. This is what most integrators do, and it's what the rest of\n  this guide assumes.\n- **You pass it through to your users.** The tool registers a separate `publisher_id` per install, so each\n  user collects their own revshare. This is the model the ADtention status-line plugin uses. See\n  [Alternative model](#alternative-model-let-each-user-earn-for-themselves).\n\n## Who this is for\n\nYou're a **developer tool**: a CLI, an editor extension, a terminal, a coding agent, an OSS\nproject. You want to show a sponsor line to *your* users and earn the revshare yourself (the\nproject earns, not the end user). You sign up **once** to receive a `publisher_id`, and every sponsored line shown\nacross all your users is credited to your account.\n\nThere are two shapes, and the SDK handles both:\n\n| | **Server-backed app** | **Locally-installed tool** |\n|---|---|---|\n| e.g. | hosted agent, web IDE, SaaS dev tool | CLI, editor extension, terminal |\n| identity | your backend holds one `publisher_id` | embed your **public** `publisher_id` in the build |\n| who is `subject` | each end user (hash their user id) | each install/machine (a random stored id) |\n| the `secret` | stays in your backend | stays with you, used only to withdraw |\n\n> **`publisher_id` is public, `secret` is private.** Serving a sponsored line needs only the `publisher_id`, so\n> it's safe to ship in a distributed binary or an OSS repo. The `secret` is needed only to bind a\n> payout destination and withdraw, so keep it out of anything you distribute.\n\n## Get a publisher account\n\nBefore you can serve, you need a `publisher_id`. Create one in the\n[ADtention portal](https://adtention.ai/onboard): you pick a client name for your tool, and it\ngives you your `publisher_id` and your payout setup. The client name is linked to your\n`publisher_id` server-side and used to roll up your traffic — you never pass it from code. This is\na **one-time** step for you. Your end users never register.\n\nThen wire it in:\n- **Hosted app:** put `publisherId` in your backend env (e.g. `ADTENTION_PUBLISHER_ID`).\n- **Distributed tool:** embed `publisherId` as a public constant in your build.\n\n> **Provisioning is separate from serving.** Creating the account is a one-time step in the portal.\n> The thing you *deploy* should serve only: pass `serveOnly: true` so it requires the provisioned\n> `publisherId` and can never call `register()`. That keeps account creation in one place, so the\n> embed won't create a stray account.\n>\n> ```ts\n> const slot = new SponsorSlot({ publisherId: 'pub_your_id', serveOnly: true, category: 'devops' });\n> ```\n\nTo get paid, add a payout destination in the portal and withdraw once you pass the $10 threshold.\n\n## Quick start\n\n### High-level: a sponsor slot in your wait state\n\n`SponsorSlot` is the high-level path. It rate-limits per end user (so you can call it on every\nrender), caches the last served sponsored line, and never throws into your UI.\n\n```ts\nimport { SponsorSlot, hashSubject } from '@adtention/sdk';\n\nconst slot = new SponsorSlot({\n  publisherId: 'pub_your_id',   // your earning account (public)\n  category: 'devops',           // your app's niche; omit for 'general'\n});\n\n// In your render loop / wait state, per end user:\nconst subject = await hashSubject(currentUserId); // opaque, PII-free\nconst ad = await slot.next({ subject });\nif (ad) {\n  render(`${ad.text}  -> ${ad.clickUrl}`); // ad.text is already terminal-safe\n}\n```\n\n`slot.next()` only hits the network once per ~15s per `subject` (the server's dwell window). In\nbetween it returns the cached line. A transient error returns the last ad (or `null`), never throws.\n\n### Low-level: the typed client\n\n`AdtentionClient` is a thin, typed wrapper over the v1 API for when you want full control.\n\n```ts\nimport { AdtentionClient } from '@adtention/sdk';\n\nconst client = new AdtentionClient({ publisherId: 'pub_your_id' });\n\nconst ad = await client.serve({ category: 'web', subject });\n// ad.text is sanitized; ad.clickUrl is absolute and http(s)-only\nconsole.log(ad.text, ad.billable, ad.credit);\n\n// Record a click (engagement only, never billed) and get the destination to open:\nconst dest = await client.recordClick(ad.impressionId);\n\n// Check earnings (account-level: the project's running balance, for your own dashboard):\nconst bal = await client.balance();\nconsole.log(bal.balanceUsd, bal.payable);\n```\n\n### A distributed CLI/extension (project earns)\n\nSame model as above, but the `publisher_id` is a public constant baked into your build, and each\ninstall gets a stable random `subject` so users are rate-limited independently. All credit pools\ninto your one account.\n\n```ts\nimport { SponsorSlot } from '@adtention/sdk';\n\nconst ADTENTION_PUBLISHER_ID = 'pub_your_id'; // public, safe to commit/ship\n\nconst slot = new SponsorSlot({ publisherId: ADTENTION_PUBLISHER_ID, category: 'devops' });\nconst subject = getOrCreateMachineId(); // a random id you persist once per install (e.g. crypto.randomUUID)\nconst ad = await slot.next({ subject });\nif (ad) console.log(ad.text);\n```\n\n## Alternative model: let each user earn for themselves\n\nThe models above all have **you** (the project) earn. If instead you want **each end user** to earn\ntheir own revshare (the model the ADtention status-line plugins for Claude Code and OpenCode use), let the tool self-register a\n*separate* `publisher_id` per install and persist it. On Node, use the file-backed store: the slot\nregisters once, reuses it forever, and self-heals if the server forgets the account. Here you do\n**not** pass a `subject`, because each install is already its own publisher.\n\n```ts\nimport { SponsorSlot } from '@adtention/sdk';\nimport { FileIdentityStore } from '@adtention/sdk/node';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nconst slot = new SponsorSlot({\n  identityStore: new FileIdentityStore(join(homedir(), '.myapp', 'adtention.json')),\n  category: 'systems',\n  ref: process.env.MYAPP_ADTENTION_REF, // optional referral code, attributed on first register\n});\n\nconst ad = await slot.next(); // no subject: this install IS the publisher\n```\n\n> Self-registration (and self-heal) happens only when you provide an `identityStore`. If you pass a\n> fixed `publisherId`, the SDK never silently mints a new account, which would otherwise orphan your\n> earnings.\n\n## Categories\n\nThe six categories are the targeting enum. Import the type and your editor autocompletes the values:\n\n```ts\nimport type { Category } from '@adtention/sdk';\n// 'web3' | 'web' | 'devops' | 'data' | 'systems' | 'general'\n```\n\nYou don't have to set a category:\n\n- **Do nothing.** It defaults to `general`, which always fills from broad/run-of-network ads. You\n  still earn.\n- **Set it once.** Most tools have a fixed niche (a Solidity tool is always `web3`). One line.\n- **Classify text you already have.** The optional `classify()` and `classifyFiles()` helpers port\n  the reference client's keyword/file heuristics and run entirely on your side:\n\n```ts\nimport { classify, classifyFiles } from '@adtention/sdk';\nclassify('we set up docker and a ci/cd pipeline');     // 'devops'\nclassifyFiles(['foundry.toml', 'package.json']);       // 'web3'  (priority order)\n```\n\nGetting the category right earns more (targeted campaigns bid higher), but it's optional.\n\n## `subject`: per-end-user scoping\n\nPass an opaque `subject` so the server scopes its rate limits (a billable impression at most once\nper ~15s, plus a daily cap) **per end user** instead of per account. Without it, all your users\nshare one account-wide limit, which is fine for a single-user CLI but broken for an app with many\nusers.\n\n- Make it **opaque**: a random per-install id, or `hashSubject(userId)`. Never raw PII.\n- Make it **stable per user** and **distinct between users**.\n- `hashSubject(raw, { salt: 'my-app' })` keeps the same user uncorrelatable across apps.\n\nAll credit from every subject accrues to your one `publisher_id`.\n\n## What leaves your process\n\nPer serve: `publisher_id`, the `category` tag, the opaque `subject`, and a `nonce`. That's it. Never\ncode, file contents, prompt text, paths, repo names, or transcripts.\n\n## API reference\n\n### `new AdtentionClient(options)`\n`{ publisherId?, secret?, serveOnly?, apiBase?, timeoutMs?, fetch? }`. `apiBase`\ndefaults to `https://api.adtention.ai`.\n\n- `serveOnly`: lock the client to serving only. Requires a `publisherId` (throws without one) and\n  makes `register()` throw. Use it in a distributed embed whose `publisherId` is provisioned out of\n  band, so the embed can never create a new account.\n\n- `register({ ref?, kind? })` returns `{ publisherId, secret, referralCode }` and adopts the identity.\n- `serve({ category?, subject?, nonce? })` returns a `ServeResult` (sanitized `text`, absolute\n  `clickUrl`, `billable`, `credit`, `dedup`).\n- `balance(publisherId?)` returns a `BalanceResult` (account-level earnings, for the project's own\n  dashboard, not the end-user render).\n- `recordClick(impressionId)` returns the destination URL as `string | null` (Node/CLI; in a\n  browser, navigate to `ad.clickUrl` directly and let the browser follow the 302).\n- `resolveClickUrl(clickUrl)` returns an absolute http(s) URL or `null`.\n- `bind(destination, secret?)` and `payout(kind?, secret?)` are management calls and need the secret.\n\n### `new SponsorSlot(options)`\n`AdtentionClient` options (including `serveOnly`) plus `{ client?, category?,\ndwellMs?, cacheMax?, identityStore?, ref?, onError? }`. `serveOnly` and `identityStore` are mutually\nexclusive: construction throws if both are set.\n\n- `next({ subject?, category? })` returns `Sponsor | null` (dwell-gated, cached, never throws).\n- `current(subject?)` returns the last `Sponsor` from cache.\n- `api` is the underlying `AdtentionClient`.\n\n### Helpers\n`getSponsorLine(opts)`, `classify(text)`, `classifyFiles(names)`, `hashSubject(raw, opts?)`,\n`newNonce()`, `sanitizeAd(s)`, `stripAnsi(s)`, `visibleWidth(s)`, `CATEGORIES`, `isCategory(v)`.\nErrors are thrown as `AdtentionError` (`.code`, `.status`, `.isNoInventory`, `.isUnknownPublisher`).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}