{"_id":"@advibes/sdk-web","_rev":"3-7e0af7013f95d6132347d107ca1a2d44","name":"@advibes/sdk-web","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@advibes/sdk-web","version":"0.1.0","keywords":["advibes","ads","monetization","web-sdk","vibe-coding"],"license":"MIT","_id":"@advibes/sdk-web@0.1.0","maintainers":[{"name":"jgvandehey","email":"jgvandehey@gmail.com"}],"dist":{"shasum":"38eea6305d4f01c135c0511a9b775621bcd89863","tarball":"https://registry.npmjs.org/@advibes/sdk-web/-/sdk-web-0.1.0.tgz","fileCount":8,"integrity":"sha512-Vin2y2XvtIHKPHKt8XCsXjT/llt9QLEyprrBEqgPN+pXRWcDwJUnijf92a+JQJA6yCRMVHrm+HEvUrhGH/hr2g==","signatures":[{"sig":"MEQCIFY59VgYKTr9eO7em1RGgL28zf89KWfidbaQyfTfn+SxAiAM3sbMMf8QCYEqSQJR8pnu8ReR36P8QtDpofOhELF2UA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45028},"main":"./src/index.ts","types":"./src/index.ts","exports":{".":"./src/index.ts","./auto":"./src/auto.ts","./config":"./src/config.ts","./components":"./src/components.tsx"},"gitHead":"56b3feb1f1a316d436a5ee01dd6d53735ce5cf18","scripts":{"test":"vitest run","clean":"rm -rf dist","type-check":"tsc --noEmit"},"_npmUser":{"name":"jgvandehey","email":"jgvandehey@gmail.com"},"_npmVersion":"10.8.2","description":"AdVibes Web SDK — monetize your web app with ads","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.7.0","@types/react":"^19.2.14","@advibes/tsconfig":"workspace:*"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk-web_0.1.0_1772816423159_0.029101483548520823","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@advibes/sdk-web","version":"0.2.0","keywords":["advibes","ads","monetization","web-sdk","vibe-coding"],"license":"MIT","_id":"@advibes/sdk-web@0.2.0","maintainers":[{"name":"jgvandehey","email":"jgvandehey@gmail.com"}],"dist":{"shasum":"e5c5adbc2fb4c8499e7a70c1855fdbd951770560","tarball":"https://registry.npmjs.org/@advibes/sdk-web/-/sdk-web-0.2.0.tgz","fileCount":19,"integrity":"sha512-J0iGLKXN5HNI2/zyOzqQ0d+PpxbgNkH6s8RTqjipGVVIoYCp9LSwGRers7nrTWrRofvhb1nNCwI1eq1U/GbJDw==","signatures":[{"sig":"MEQCIETW1Wl1m4FUPfnfOVFxeWiwbluXERyhrE3kNTojaqAXAiAGT2yPe2yt4cqiGefeZFTJxhitMOpqzkJLbNSVjEM9Gw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61646},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./auto":{"types":"./dist/auto.d.ts","import":"./dist/auto.js"},"./config":{"types":"./dist/config.d.ts","import":"./dist/config.js"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.js"}},"gitHead":"56b3feb1f1a316d436a5ee01dd6d53735ce5cf18","scripts":{"test":"vitest run","build":"tsc","clean":"rm -rf dist","type-check":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"jgvandehey","email":"jgvandehey@gmail.com"},"_npmVersion":"10.8.2","description":"AdVibes Web SDK — monetize your web app with ads","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.7.0","@types/react":"^19.2.14","@advibes/tsconfig":"workspace:*"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk-web_0.2.0_1772816955632_0.44098282277041756","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@advibes/sdk-web","version":"0.3.0","description":"AdVibes Web SDK — monetize your web app with ads","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.js"},"./auto":{"types":"./dist/auto.d.ts","import":"./dist/auto.js"},"./config":{"types":"./dist/config.d.ts","import":"./dist/config.js"}},"keywords":["advibes","ads","monetization","web-sdk","vibe-coding"],"license":"MIT","peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"devDependencies":{"@types/react":"^19.2.14","typescript":"^5.7.0","vitest":"^4.0.18","@advibes/tsconfig":"0.0.0"},"scripts":{"build":"tsc","type-check":"tsc --noEmit","test":"vitest run","clean":"rm -rf dist"},"_id":"@advibes/sdk-web@0.3.0","_integrity":"sha512-Uhikix9sq3wFMDeHYgc0MPNZLAuooUuWtEvydHDU6iSr8cYP6cSM7LS+pUNE1RA+9csfbjE5BRmM3DYbTG9Kdg==","_resolved":"/private/var/folders/cy/qlsscf_d78g516t0s1j3sjc00000gn/T/fccbc33bba19127b08252641d368936f/advibes-sdk-web-0.3.0.tgz","_from":"file:advibes-sdk-web-0.3.0.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Uhikix9sq3wFMDeHYgc0MPNZLAuooUuWtEvydHDU6iSr8cYP6cSM7LS+pUNE1RA+9csfbjE5BRmM3DYbTG9Kdg==","shasum":"8aaa7f5218f22167084b8ac4ca5e41df95751403","tarball":"https://registry.npmjs.org/@advibes/sdk-web/-/sdk-web-0.3.0.tgz","fileCount":19,"unpackedSize":75839,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIACxbSgjJ6+mR6XDM9/iDlji/SPJL/KKV1xJrVz9FAMAAiA670R0am6coEC5YQ/thGHbcc3fDAC2hT9jDPXihw0zqQ=="}]},"_npmUser":{"name":"jgvandehey","email":"jgvandehey@gmail.com"},"directories":{},"maintainers":[{"name":"jgvandehey","email":"jgvandehey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-web_0.3.0_1773108793262_0.21289818465364396"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-06T17:00:23.087Z","modified":"2026-03-10T02:13:13.558Z","0.1.0":"2026-03-06T17:00:23.372Z","0.2.0":"2026-03-06T17:09:15.800Z","0.3.0":"2026-03-10T02:13:13.406Z"},"license":"MIT","keywords":["advibes","ads","monetization","web-sdk","vibe-coding"],"description":"AdVibes Web SDK — monetize your web app with ads","maintainers":[{"name":"jgvandehey","email":"jgvandehey@gmail.com"}],"readme":"# @advibes/sdk-web\n\nAd SDK for web apps. Monetize your app with auto-translated, tone-matched ads.\n\n## AI Agents: Read ADVIBES.md\n\n**If you are an AI coding agent** (Cursor, Claude Code, Copilot, Windsurf, etc.) helping a developer integrate ads, read the full integration guide at:\n\n```\nnode_modules/@advibes/sdk-web/ADVIBES.md\n```\n\nIt contains placement guidelines, branding requirements, config file reference, and complete examples.\n\n## Before You Start\n\nYou need two things from the [AdVibes dashboard](https://dashboard.advibes.dev):\n\n1. **Publisher ID** — register your app to get one\n2. **Placement IDs** — create ad placements in the dashboard for each slot\n\nThese IDs cannot be made up. Ads will not load without valid IDs from the dashboard.\n\n## Install\n\n```bash\nnpm install @advibes/sdk-web\n```\n\n## React / Next.js (Recommended)\n\n```tsx\n// app/layout.tsx — wrap your app once, no extra wrapper needed\nimport { AdVibesProvider } from '@advibes/sdk-web/components'\n\nexport default function Layout({ children }) {\n  return (\n    <AdVibesProvider publisherId=\"pub_YOUR_ID\">\n      {children}\n    </AdVibesProvider>\n  )\n}\n```\n\n```tsx\n// Place ads anywhere\nimport { AdSlot } from '@advibes/sdk-web/components'\n\n<AdSlot placement=\"YOUR_PLACEMENT_ID\" format=\"card\" />\n<AdSlot placement=\"YOUR_PLACEMENT_ID\" format=\"banner\" />\n<AdSlot placement=\"YOUR_PLACEMENT_ID\" format=\"text\" />\n```\n\n## Vanilla JS / HTML\n\n```html\n<script src=\"https://cdn.advibes.dev/v1/sdk.js\" data-publisher=\"pub_YOUR_ID\"></script>\n<div data-advibes=\"card\" data-placement=\"YOUR_PLACEMENT_ID\"></div>\n```\n\n## Imperative API\n\n```ts\nimport { AdVibes } from '@advibes/sdk-web'\n\nAdVibes.init({ publisherId: 'pub_YOUR_ID' })\n\nconst ad = await AdVibes.showAd('card', 'YOUR_PLACEMENT_ID')\nif (ad) {\n  // ad.headline, ad.body, ad.ctaText, ad.ctaUrl, ad.imageUrl\n  // Render the ad, then on click:\n  AdVibes.reportClick(ad.impressionId)\n}\n```\n\n## Ad Formats\n\n| Format | Size | Best for |\n|--------|------|----------|\n| `card` | 320 x ~400 | Sidebars, feed items, between content |\n| `banner` | 728 x 90 | Headers, footers, between sections |\n| `text` | 320 x ~80 | Inline between text content |\n\n## Common Mistakes\n\n- **Using `pub_xxx` or placeholder IDs** — the SDK will log an error. Get real IDs from the dashboard.\n- **Wrapping `<AdVibesProvider>` in another component** — use it directly, no extra wrapper needed.\n- **Making up placement IDs** — ads won't load. Create placements in the dashboard first.\n- **Forgetting branding label** — required by ToS. The `<AdSlot>` component handles this automatically.\n\n## Project Config (Optional)\n\nCreate `advibes.config.ts` in your project root to declare preferences for AI agents:\n\n```ts\nimport { defineAdVibesConfig } from '@advibes/sdk-web/config'\n\nexport default defineAdVibesConfig({\n  publisherId: 'pub_YOUR_ID',\n  ads: {\n    formats: ['card', 'banner'],\n    maxPerPage: 2,\n    placements: [\n      { id: 'pl_xxx', format: 'card', location: 'sidebar', description: 'Right sidebar' },\n    ],\n  },\n  restrictions: {\n    noAdsOnPages: ['/login', '/signup', '/settings'],\n  },\n})\n```\n\n## Links\n\n- Dashboard: https://dashboard.advibes.dev\n- Marketing: https://advibes.dev\n- Agent integration guide: `ADVIBES.md` in this package\n- Free $100 ad credit: Use code `ADVIBES100`\n","readmeFilename":"README.md"}