{"_id":"@bildit-platform/ai-pixel","_rev":"19-da35bd2b1cc7321c66eff8086f0fdf15","name":"@bildit-platform/ai-pixel","dist-tags":{"latest":"1.5.0"},"versions":{"1.0.0":{"name":"@bildit-platform/ai-pixel","version":"1.0.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.0.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"derekbell","email":"derek.bell@bildit.co"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"9148ac5aaec9db7c273b8cb7ec7e1461a7d1a28a","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.0.0.tgz","fileCount":4,"integrity":"sha512-AdrfP8msV/XVQ4L8VWoG+QUW1X/eNCxABRB3Km/04ayMPKvqiq3EgsA3qjuhThZxj1wrSyufYN9zVO0VkeVOoQ==","signatures":[{"sig":"MEQCIA6+d1c/9MN8cTvPPjXyNmCNFww0hn8OQqgNddAz8TUIAiBqWfGAoJXDtdmn2YSzNdzIPXUzIvv1R3NAnsuv8tFWXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3817},"main":"index.js","types":"index.d.ts","_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"_npmVersion":"10.8.2","description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"_nodeVersion":"20.19.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.0.0_1758474249181_0.3514862691410434","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bildit-platform/ai-pixel","version":"1.1.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.1.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"derekbell","email":"derek.bell@bildit.co"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"7444744584d57b6ef2c09b2ac612c349c3b8a111","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.1.0.tgz","fileCount":11,"integrity":"sha512-WknkO+oIBWM05br+egS3Abn/szRaQ2FkMaeqS0AN1qjISVhKwqF31jBSXWoqR4cPq1Y0IoMAHBRbj+BNV8ZZuA==","signatures":[{"sig":"MEUCIEjTTuRLeQWxExdPfq2Dkwri1upq6w6H5DPqrzhaAyjZAiEAnIQ48BbAAVqZv3mUozOn8NYe+g5FTpKKCwVMNKaXHkM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37717},"main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"},"./react":{"types":"./react/index.d.ts","default":"./react/index.js","require":"./react/index.js"},"./nextjs":{"types":"./nextjs/index.d.ts","default":"./nextjs/index.js","require":"./nextjs/index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","peerDependencies":{"next":">=12.0.0","react":">=16.8.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.1.0_1758579311948_0.7175795959497606","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bildit-platform/ai-pixel","version":"1.2.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.2.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"derekbell","email":"derek.bell@bildit.co"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"0311b650708ab6351c755ccd94dd6eaec052743f","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.2.0.tgz","fileCount":11,"integrity":"sha512-HM4FBwMaWMmeecHKybcXCaHVaDwCWln0/Qb46pzTrcWosDqU3GT8vC5Qr4p1EmJJ1HAIpw1Ppasr3XT3Q7xQyA==","signatures":[{"sig":"MEYCIQDi9ROrenTRWsh3jhecbYFNabWnJfB2WL901Os7GkWsvgIhAOCmjC9ql5g85pVf+wHCOhmve+JHuiH4lkCqqfcGOku9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39375},"main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"},"./react":{"types":"./react/index.d.ts","default":"./react/index.js","require":"./react/index.js"},"./nextjs":{"types":"./nextjs/index.d.ts","default":"./nextjs/index.js","require":"./nextjs/index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"dependencies":{"playwright":"^1.55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","peerDependencies":{"next":">=12.0.0","react":">=16.8.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.2.0_1758597499598_0.10365095742357622","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@bildit-platform/ai-pixel","version":"1.3.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.3.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"derekbell","email":"derek.bell@bildit.co"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"fe569f8325efc09529333636312e3679ba1d9bbb","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.3.0.tgz","fileCount":11,"integrity":"sha512-6x9Ka5ysZnbygp1b3k8DXGbhcy5rtrtzkGcsj7hnL4jvMMQdh+2potk2xSEye7AwqZuuhE1bCSKSDqwio2wGeA==","signatures":[{"sig":"MEUCIQDgkI+0PvSAHmvrBX++yluhS177hgbtxYX1kwF8jXS47gIgI/nBPHfzLYGntVPofHBHJRoj1wjT6RtQWzeyCJOsaPA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44509},"main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"},"./react":{"types":"./react/index.d.ts","default":"./react/index.js","require":"./react/index.js"},"./nextjs":{"types":"./nextjs/index.d.ts","default":"./nextjs/index.js","require":"./nextjs/index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"dependencies":{"playwright":"^1.55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","peerDependencies":{"next":">=12.0.0","react":">=16.8.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.3.0_1758633345907_0.6087406732586631","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@bildit-platform/ai-pixel","version":"1.4.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.4.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"derekbell","email":"derek.bell@bildit.co"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"6141a6b7d94e273fb2ac9a374fe130bd8a27f6ff","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.4.0.tgz","fileCount":11,"integrity":"sha512-76/JcJ/nY387G7518xRTpyiN4egL0dGyOwbAzU8/JnmhAUmpmlQpqDHBwWS1/EXWjJNqsfenZow0w4BMVGcOkg==","signatures":[{"sig":"MEUCIQDkDdzkag0HtBKwKuYAIEMq3K3ypx3Xcq/4n1XxKj57lwIgT/5Gz9hg2rNh1kly6JXmHetQ+GrN2UIwPFvLG2PxT04=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45360},"main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"},"./react":{"types":"./react/index.d.ts","default":"./react/index.js","require":"./react/index.js"},"./nextjs":{"types":"./nextjs/index.d.ts","default":"./nextjs/index.js","require":"./nextjs/index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"dependencies":{"playwright":"^1.55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","peerDependencies":{"next":">=12.0.0","react":">=16.8.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.4.0_1758646798984_0.02944572796069833","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@bildit-platform/ai-pixel","version":"1.5.0","keywords":["react","pixel","tracking","bildit"],"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","_id":"@bildit-platform/ai-pixel@1.5.0","maintainers":[{"name":"bilditsupport","email":"npm@bildit.co"},{"name":"addingamabertaqwa","email":"addingama@gmail.com"},{"name":"saranyam","email":"saranya@bildit.co"},{"name":"okorsia_bildit","email":"oleksandr.korsia@bildit.co"},{"name":"garrkev","email":"kevin@bildit.co"},{"name":"lorddut","email":"jason@bildit.co"},{"name":"wesleyguirra","email":"wesleeycosta7@gmail.com"},{"name":"shadifmg","email":"shadman@bildit.co"},{"name":"sergeybildit","email":"sergey@bildit.co"},{"name":"abhay_npm005","email":"abhay.chaturvedi005@gmail.com"},{"name":"aaqib925","email":"muhammad.aqib@bildit.co"}],"homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"dist":{"shasum":"89cb256c01d46249a596bdab78fa6925c7b7a94d","tarball":"https://registry.npmjs.org/@bildit-platform/ai-pixel/-/ai-pixel-1.5.0.tgz","fileCount":11,"integrity":"sha512-oiaGXng4ub3ZKChT5OZH1gS75gMOP1Lq/WaBzHIu4aYmW/MmCX+69ZEZCmjION759cz45gJlJJlxiFGz3Mw5+g==","signatures":[{"sig":"MEQCIDFOcqMi6/1TZxVaXczc6MNlz2h9DGj8IOMW5av+7vmvAiAaJH+KoPq/yb6Ug/PiK65ct/UbzQMBiIYP3UJaimJdHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46580},"main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"},"./react":{"types":"./react/index.d.ts","default":"./react/index.js","require":"./react/index.js"},"./nextjs":{"types":"./nextjs/index.d.ts","default":"./nextjs/index.js","require":"./nextjs/index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"bilditsupport","email":"npm@bildit.co"},"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","directories":{},"sideEffects":false,"dependencies":{"playwright":"^1.55.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","peerDependencies":{"next":">=12.0.0","react":">=16.8.0"},"peerDependenciesMeta":{"next":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ai-pixel_1.5.0_1758651973001_0.5940956555490282","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-09-21T17:04:09.097Z","modified":"2026-09-09T03:21:08.936Z","1.0.0":"2025-09-21T17:04:09.347Z","1.1.0":"2025-09-22T22:15:12.148Z","1.2.0":"2025-09-23T03:18:19.773Z","1.3.0":"2025-09-23T13:15:46.085Z","1.4.0":"2025-09-23T16:59:59.197Z","1.5.0":"2025-09-23T18:26:13.211Z"},"bugs":{"url":"https://github.com/BILDIT/bildit-platform-ai-pixel/issues"},"author":{"name":"BILDIT Platform","email":"support@bildit.co"},"license":"MIT","homepage":"https://github.com/BILDIT/bildit-platform-ai-pixel#readme","keywords":["react","pixel","tracking","bildit"],"repository":{"url":"git+https://github.com/BILDIT/bildit-platform-ai-pixel.git","type":"git"},"description":"Simple React component to render the BILDIT AI Pixel.","maintainers":[{"email":"npm@bildit.co","name":"bilditsupport"},{"email":"kevin@bildit.co","name":"garrkev"},{"email":"jason@bildit.co","name":"lorddut"}],"readme":"# @bildit-platform/ai-pixel\n\nHigh-agency pixel helpers for React and Next.js that render the public BILDIT AI beacon (`https://ai-pixel.bildit.co/pixel.gif`). Import `@bildit-platform/ai-pixel/react` for the base component or `@bildit-platform/ai-pixel/nextjs` for wrappers that lean on `next/script`, iframe and `<noscript>` fallbacks, and progressive JavaScript beacons that report mouse movement and user-agent data.\n\n## Install\n\n```bash\nnpm install @bildit-platform/ai-pixel\n# or\nyarn add @bildit-platform/ai-pixel\n# or\npnpm add @bildit-platform/ai-pixel\n```\n\n> **Note**: `react` is a peer dependency. The `nextjs` entry additionally expects `next` in your workspace (declared as an optional peer dependency).\n\n## Usage\n\nBefore adding the pixel, head to https://signup.bildit.co/aipixel and submit your site URL, site name, and contact email so we can provision the pixel.\n\n### React apps\n\n```tsx\nimport { BILDITAIPixel } from '@bildit-platform/ai-pixel/react';\n\nexport function App() {\n  return (\n    <main>\n      <h1>Welcome to BILDIT!</h1>\n      <BILDITAIPixel params={{ site: 'marketing-site' }} />\n    </main>\n  );\n}\n```\n\nThe component forwards refs and accepts every standard `<img>` prop. For example, you can pass `className`, `style`, or `loading` attributes:\n\n```tsx\n<BILDITAIPixel className=\"hidden\" loading=\"lazy\" />\n```\n\n### Next.js (App or Pages router)\n\n```tsx\n// app/layout.tsx or pages/_app.tsx\nimport { NextBILDITAIPixel } from '@bildit-platform/ai-pixel/nextjs';\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  return (\n    <html lang=\"en\">\n      <body>\n        {children}\n        <NextBILDITAIPixel params={{ site: 'marketing-site' }} />\n      </body>\n    </html>\n  );\n}\n```\n\n`NextBILDITAIPixel` renders the hidden `<img>`, iframe, and `<noscript>` fallbacks and injects the JavaScript beacon through `next/script`. Pass `includeScript={false}` if you only want the static surfaces, or supply script overrides with `scriptId`, `scriptStrategy`, `scriptNonce`, or `scriptProps`.\n\n## API\n\n### React entry (`@bildit-platform/ai-pixel/react`)\n\n- `BILDITAIPixel` – React component that renders the pixel image plus optional iframe, `<noscript>`, and inline-script pings.\n- `PIXEL_URL` – Constant for the raw pixel URL (`https://ai-pixel.bildit.co/pixel.gif`).\n- `DEFAULT_ALT` – Default `alt` text (`\"BILDIT AI Pixel Tracker\"`).\n- `buildPixelInlineScript(params)` – Produces the same inline JavaScript beacon string the component inlines.\n- `normalizePixelParams(params)` – Utility that coalesces query params into a plain `{ [key: string]: string }` object.\n\nThe component accepts all `React.ImgHTMLAttributes<HTMLImageElement>`. Every render includes cache-busting JavaScript beacons that report the browser mouse movement (once) and user agent string, followed by hidden iframe + `<noscript>` layers to catch HTML-only or JS-disabled crawlers.\n\n#### `<BILDITAIPixel />` props\n\n- `pixelUrl` – Override the destination pixel (e.g. your own CF Worker endpoint).\n- `params` – Extra query params merged into every request (`{ campaign: 'spring' }`).\n- `mode` – Choose which surfaces render. Accepts a single option or an array of options (`auto`, `server`, `image`/`img`, `iframe`, `noscript`, `script`). Arrays let you combine surfaces directly (`['img', 'noscript']`).\n- `iframeProps` – Pass-thru attributes for the hidden iframe (title, style overrides, etc.).\n- `scriptId` / `scriptNonce` – Control inline `<script>` attributes for CSP compatibility.\n\n#### Server rendering\n\nUse `mode=\"server\"` (or leave the default `auto`) to safely stream the pixel during SSR. The emitted markup avoids accessing `window`/`document` during React rendering, so it works in Node.js, Edge runtimes, and static export workflows.\n\n```tsx\n// Example: Remix or vanilla React SSR\nimport { BILDITAIPixel } from '@bildit-platform/ai-pixel/react';\n\nexport function Document() {\n  return (\n    <html lang=\"en\">\n      <body>\n        <BILDITAIPixel params={{ site: 'marketing-site' }} />\n      </body>\n    </html>\n  );\n}\n```\n\n#### Client-only selections\n\nRestrict rendering to specific surfaces when you do not need the entire stack:\n\n```tsx\n// Only inline script + JS beacons\n<BILDITAIPixel mode=\"script\" params={{ placement: 'spa' }} />\n\n// Only the raw <img>\n<BILDITAIPixel mode={['img']} style={{ position: 'static' }} />\n```\n\n### Next.js entry (`@bildit-platform/ai-pixel/nextjs`)\n\n- `NextBILDITAIPixel` – Bundles the React component with a `next/script` inline beacon.\n- `BILDITAIPixelScript` – Stand-alone helper that only injects the JavaScript beacon via `next/script` (useful if you want to position the `<img>` yourself).\n- `trackAIBotRequestForPixel(request, options)` – Server-side helper that inspects a request’s referer + user-agent for AI crawler signatures and performs a pixel hit with that context.\n- `identifyAIBot(userAgent)` / `AI_BOT_SIGNATURES` – Utilities that expose the signature matching used by the tracker.\n- `BILDITAIPixel`, `PIXEL_URL`, `DEFAULT_ALT`, `buildPixelInlineScript`, `normalizePixelParams` – Re-exported from the React entry for convenience.\n\n#### `<NextBILDITAIPixel />` props\n\n- Inherits all non-script props from `<BILDITAIPixel />` (e.g. `params`, `iframeProps`, `className`).\n- `mode` – Same as the React component, but the helper automatically strips the inline `<script>` surface and defaults to `['img', 'iframe', 'noscript']`.\n- `includeScript` – Set to `false` to skip the JavaScript beacon and only emit the static surfaces.\n- `scriptId`, `scriptNonce`, `scriptStrategy` – Passed through to `next/script` for CSP and loading control.\n- `scriptProps` – Additional props merged into the underlying `next/script` element.\n\n#### Server-side bot detection\n\n`trackAIBotRequestForPixel` inspects incoming headers for AI crawler signatures (ChatGPT, Claude, Perplexity, Gemini, Grok, Kimi, DeepSeek, etc.) and, when matched, pings the pixel with referer/user-agent data.\n\n```ts\n// middleware.ts (Next.js 13+)\nimport { NextResponse } from 'next/server';\nimport { trackAIBotRequestForPixel } from '@bildit-platform/ai-pixel/nextjs';\n\nexport async function middleware(request: Request) {\n  await trackAIBotRequestForPixel(request, {\n    params: { edge: 'middleware' },\n  });\n\n  return NextResponse.next();\n}\n```\n\nThe helper accepts any object with a `headers` property (e.g. `GetServerSidePropsContext.req`). Override detection by passing `force: true` or supply custom `headers`, `userAgent`, and `referer` values. The matched bot slug is stored in the `bot` query param; hook into the exported `identifyAIBot`/`AI_BOT_SIGNATURES` for custom logging.\n\n#### `<BILDITAIPixelScript />` props\n\n- Accepts `pixelUrl`, `params`, `alt`, `scriptId`, `scriptNonce`, and `scriptStrategy` plus any extra `next/script` props. Emits only the inline JavaScript beacon.\n\n## Integration recipes\n\nLayer these techniques to cover a wide range of renderers (static HTML, CMS templates, JS-heavy apps, AI crawlers, etc.). Replace the example pixel URL with your provisioned endpoint if needed.\n\n### Static HTML (Any Site)\n\n**Option A: JavaScript embed**\n\n```html\n<script>\n  const params = new URLSearchParams({\n    t: Date.now().toString(),\n    r: Math.random().toString(36).slice(2),\n  });\n  const img = new Image();\n  img.src = `https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?${params}`;\n  img.alt = '';\n  img.width = 1;\n  img.height = 1;\n  img.style.display = 'none';\n  document.body.appendChild(img);\n</script>\n```\n\n**Option B: No JavaScript fallback**\n\n```html\n<img src=\"https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?cachebuster={{ new Date().getTime() }}\"\n     alt=\"\" width=\"1\" height=\"1\" style=\"display:none;\" loading=\"lazy\">\n```\n\nReplace the `cachebuster` expression with any server-side template language you have available.\n\n### HubSpot Pages\n\nHubSpot exposes Liquid-like template variables you can use to bust caches:\n\n```html\n{% set now = local_dt|strftime('%s') %}\n{% set rand = range(10000, 99999) | random %}\n<img src=\"https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?t={{ now }}&r={{ rand }}&hubspot=true\"\n     alt=\"\" width=\"1\" height=\"1\" style=\"display:none;\">\n```\n\nIf you prefer JavaScript, Option A from the static HTML section works in HubSpot as well.\n\n### React (CSR)\n\nCreate a component that injects the pixel on mount:\n\n```tsx\nimport { useEffect } from 'react';\n\nexport function PixelTracker() {\n  useEffect(() => {\n    const params = new URLSearchParams({\n      t: Date.now().toString(),\n      r: Math.random().toString(36).slice(2),\n    });\n    const img = new Image();\n    img.src = `https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?${params}`;\n    img.alt = '';\n    img.width = 1;\n    img.height = 1;\n    img.style.display = 'none';\n    document.body.appendChild(img);\n    return () => {\n      document.body.removeChild(img);\n    };\n  }, []);\n\n  return null;\n}\n```\n\nRender `<PixelTracker />` once near the root of your app.\n\n### Next.js (App or Pages Router)\n\n#### Using the packaged helper\n\n```tsx\nimport { NextBILDITAIPixel } from '@bildit-platform/ai-pixel/nextjs';\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  return (\n    <html lang=\"en\">\n      <body>\n        {children}\n        <NextBILDITAIPixel params={{ app: 'marketing-site' }} />\n      </body>\n    </html>\n  );\n}\n```\n\nFor advanced placement, use the lower-level `BILDITAIPixelScript` alongside the React component to decide exactly where the `<script>` and `<img>` land.\n\n#### Static `<img>` with cache busting\n\nIf you need a purely static image (for example in `next export`), add a query that changes during the build:\n\n```jsx\n<img\n  src={`https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?build=${process.env.NEXT_PUBLIC_BUILD_ID}`}\n  alt=\"\"\n  width={1}\n  height={1}\n  style={{ display: 'none' }}\n  loading=\"lazy\"\n/>\n```\n\n✅ Ensure `NEXT_PUBLIC_BUILD_ID` is unique per deployment (Git SHA, timestamp, etc.).\n\n### Alternative Embed Techniques\n\nSometimes you need to cover edge cases where automated agents (like ChatGPT link previews) primarily fetch the raw HTML and may or may not execute JavaScript. Consider layering one or more of the following approaches on top of the options above:\n\n#### 1. Inline `<img>` in the HTML shell\n\nPlace a basic `<img>` tag high in the HTML so even simple HTML-only fetchers request the pixel:\n\n```html\n<img src=\"https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?seed=static\"\n     alt=\"\" width=\"1\" height=\"1\" style=\"display:none;\" loading=\"lazy\" decoding=\"async\">\n```\n\nEven if JavaScript doesn’t run, the page fetcher often retrieves referenced images. Pair this with a dynamic pixel elsewhere for real users to avoid caching.\n\n#### 2. Hidden `<iframe>`\n\nAn iframe can force a secondary request in contexts where images are ignored but HTML is parsed:\n\n```html\n<iframe src=\"https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?iframe=true\"\n        title=\"analytics\"\n        loading=\"lazy\"\n        width=\"1\"\n        height=\"1\"\n        style=\"border:0; opacity:0; position:absolute; width:1px; height:1px;\">\n</iframe>\n```\n\nBrowsers usually treat a GIF inside an iframe as a navigable resource, triggering the same worker logic.\n\n#### 3. `<noscript>` fallback\n\nAlways provide a plain `<img>` for environments where JavaScript is disabled or stripped:\n\n```html\n<noscript>\n  <img src=\"https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?fallback=noscript\"\n       alt=\"\" width=\"1\" height=\"1\" style=\"display:none;\">\n</noscript>\n```\n\nThis works for privacy-focused browsers and certain crawlers.\n\n#### 4. CSS background pixel\n\nEmbed the pixel in a CSS rule so that layout engines fetching linked stylesheets make the request:\n\n```html\n<style>\n  body::after {\n    content: '';\n    display: none;\n    background-image: url('https://pixel-tracker.bildit-cloudflare.workers.dev/pixel.gif?css=true');\n  }\n</style>\n\n```\n\n\n## Bot trigger automation (experimental)\n\nAn optional Playwright helper lives at `scripts/bot-trigger.js`. It opens several AI chat surfaces (ChatGPT, Perplexity, Claude, Gemini, Grok, Kimi, DeepSeek, …) and asks about `bildit.co`, while also pinging the BILDIT pixel. If API credentials are available, the script calls the corresponding HTTP APIs to exercise server-side pixel hits as well.\n\n1. Install Playwright if you have not already:\n   ```bash\n   npm install --save-dev playwright\n   npx playwright install chromium\n   ```\n2. Ensure you are running on Node.js 18+ so that `fetch` is globally available.\n3. Export any API keys you control, e.g.:\n   ```bash\n   export OPENAI_API_KEY=...\n   export PERPLEXITY_API_KEY=...\n   export ANTHROPIC_API_KEY=...\n   export GEMINI_API_KEY=...\n   export DEEPSEEK_API_KEY=...\n   export GROK_API_KEY=...\n   export MOONSHOT_API_KEY=...\n   ```\n4. Run the script:\n   ```bash\n   node scripts/bot-trigger.js\n   ```\n\nMany providers require an authenticated session before their chat UIs accept input. Sign in manually in the launched browser (set `HEADLESS=false` to observe execution) or provide persisted auth state before automation.\n\n## Publishing (maintainers)\n\n1. Log in with the scoped account: `npm login --scope=@bildit-platform`.\n2. Make sure the version in `package.json` is unique.\n3. Publish the package as public (only required the first time for this scope):\n   ```bash\n   npm publish --access public\n   ```\n\nThe package will appear at <https://www.npmjs.com/package/@bildit-platform/ai-pixel> after publishing.\n\n## License\n\nMIT © BILDIT Platform\n","readmeFilename":"README.md"}