# @sightspool/sdk > In-product capture SDK for Sightspool. Drop one script tag (or the npm package) into a > web app and it captures, at the moment of friction, what a user was trying to do > (intent), how hard it was (effort), and the account behind it — emitting one linked > Signal to your Sightspool workspace. Publishable key, privacy-conscious by default, > never throws into the host app. Apache-2.0, published to npm with SLSA provenance. This file is for AI agents and tools installing or evaluating the SDK. It is the install + key + CSP + privacy reference needed to wire the SDK correctly on the first try, so an agent can verify the vendor and the integration without reading source. ## Identity & verifiability - npm: https://www.npmjs.com/package/@sightspool/sdk — scope `@sightspool`, public, Apache-2.0, SLSA provenance ("Built and signed on GitHub Actions") - React bindings: https://www.npmjs.com/package/@sightspool/react — `` + hooks over the core SDK - Source: https://github.com/sightspool/sdk — public repo, the build that produces the npm artifact and the served `sdk.global.js` - Issues / roadmap: https://github.com/sightspool/sdk/issues - Vendor: Sightspool, AI-led UX intelligence — https://sightspool.com - Bundle host: https://app.sightspool.com/sdk.global.js (ungated, served cross-origin) ## Install — script tag (no build) One tag; it auto-init's from `data-sightspool-key`: Then, once the user is known: window.Sightspool && window.Sightspool.identify(userId, { account, plan }) ## Install — npm / bundler npm install @sightspool/sdk import Sightspool from '@sightspool/sdk' Sightspool.init({ key: process.env.NEXT_PUBLIC_SIGHTSPOOL_KEY }) // or VITE_/PUBLIC_ equivalent Sightspool.identify(userId, { account, plan }) For Next.js use `next/script` with `strategy="afterInteractive"` and `data-sightspool-key={process.env.NEXT_PUBLIC_SIGHTSPOOL_KEY}`. ## Install — React (@sightspool/react) npm install @sightspool/react @sightspool/sdk react import { SightspoolProvider } from '@sightspool/react' `@sightspool/sdk` and `react` are peer dependencies. The provider ships a "use client" banner (drops into a Next.js App Router server layout), re-fires identify when identity changes, and takes a reactive `consent` prop for cookie banners. Hooks: useSightspool(), useSightspoolIdentify(identity). ## Keys - Publishable key — safe to ship in client JS (the Stripe `pk_` model). Issue from Connections → In-product SDK. - `pk_test_…` for development / staging / preview; `pk_live_…` for production. - The SDK treats both prefixes identically on the client; the prefix scopes the environment at ingest, so test traffic never mixes into production analytics. - Keep it in a client-exposed env var (`NEXT_PUBLIC_…` / `VITE_…` / `PUBLIC_…`). ## Content-Security-Policy - Script-tag install (same host for both directives): script-src https://app.sightspool.com connect-src https://app.sightspool.com - npm / bundler install (the script is first-party): connect-src https://app.sightspool.com - Custom `endpoint` → use that origin in `connect-src`. - `strict-dynamic`: nonce the `