{"_id":"@appboard-ai/sdk","_rev":"5-d91394603504ed0340b8051faebd61a2","name":"@appboard-ai/sdk","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"@appboard-ai/sdk","version":"0.0.1","keywords":["onboarding","app","customer"],"author":{"name":"Appboard-AI"},"license":"ISC","_id":"@appboard-ai/sdk@0.0.1","maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"dist":{"shasum":"bde73259acb5e45c445e73b26ba9f994cf0cca9f","tarball":"https://registry.npmjs.org/@appboard-ai/sdk/-/sdk-0.0.1.tgz","fileCount":3,"integrity":"sha512-Sg1fXLCuIJRv4FAi9ZqivD85QRpETgKhDjy/KxzDqKBDz4ZBAuOgNqgtjZrkOOwxpgkQdYKaLspsbbxVVq2VHw==","signatures":[{"sig":"MEYCIQDsVc94ugeNRQXsvBViKbch8Wl3LV0rKmlAikVCqFnOagIhAOuP4UDAPin70z2tdJY+ZTBYqOwg6DMhvJWUadNp2/Kt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1626},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"djokerg","email":"grebovicdjole@gmail.com"},"_npmVersion":"10.9.4","description":"Official Appboard SDK for embeddable onboarding boards","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.1_1778178115975_0.2950082518314354","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@appboard-ai/sdk","version":"0.0.2","keywords":["onboarding","app","customer","activation"],"author":{"name":"Appboard-AI"},"license":"ISC","_id":"@appboard-ai/sdk@0.0.2","maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"dist":{"shasum":"be6fd91a779e6e6ea8a4748fa0c871a4d6566513","tarball":"https://registry.npmjs.org/@appboard-ai/sdk/-/sdk-0.0.2.tgz","fileCount":8,"integrity":"sha512-01HJgwWhvmooOJIPLq5QZ95e/1wXwBhlhzY0R6nmO4c71S0pSrLsHYK68Ql7mY6dGmvSgirA42gHK/FNk90cww==","signatures":[{"sig":"MEYCIQD2lii4iGEoDUcd2D1ZnkM2il1Mh1teKlHld6gKoDrpOAIhAKVLsj7uunQwmLiTDOXdzF5/GBuSyl46UHIM8GHIfY4W","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19709},"main":"./dist/appboard.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/appboard.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/appboard.mjs"},"./browser":"./dist/appboard.iife.js"},"gitHead":"8acfa65aba4d0a71ec7d0ddfe3ac17532a2f23c5","scripts":{"build":"rm -rf dist && bun build src/index.ts --outfile dist/appboard.mjs --format esm --target browser && bun build src/iife.ts --outfile dist/appboard.iife.js --format iife --target browser && tsc --emitDeclarationOnly --outDir dist","prepare":"husky","typecheck":"tsc --noEmit","demo:build":"bun build src/iife.ts --outfile examples/appboard.iife.js --format iife --target browser","demo:serve":"bun --bun -e 'import { serve } from \"bun\"; serve({ port: 8080, fetch: (req) => { const path = new URL(req.url).pathname === \"/\" ? \"/demo.html\" : new URL(req.url).pathname; return new Response(Bun.file(`examples${path}`)); } }); console.log(\"http://localhost:8080\")'"},"_npmUser":{"name":"djokerg","email":"grebovicdjole@gmail.com"},"_npmVersion":"10.9.4","description":"Official Appboard SDK for embeddable onboarding boards","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.6.3","@commitlint/cli":"^19.6.1","@commitlint/config-conventional":"^19.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.2_1778504936352_0.9472871732110466","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@appboard-ai/sdk","version":"0.0.3","keywords":["onboarding","app","customer","activation"],"author":{"name":"Appboard-AI"},"license":"ISC","_id":"@appboard-ai/sdk@0.0.3","maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"dist":{"shasum":"318378d7ecdadabcd4338eb7c483389dd249f43a","tarball":"https://registry.npmjs.org/@appboard-ai/sdk/-/sdk-0.0.3.tgz","fileCount":13,"integrity":"sha512-EQN66dZGNIJpA0A+3ifzXfiOjjwO0KLa9V/4aTWU8VXexgrDFv5b1cGSXyG6eCUn8f8c7fDwlY+j9byf58qlAQ==","signatures":[{"sig":"MEUCIQCYx66s6CvvzkN/pSEj9RHvmymXUQIxak1XlVFqIbXlkAIgOOllrTFzqM95Cm7DtDHLokkUVqXUVZCH04LbgSPxvwg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22322},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs"},"./board":{"types":"./dist/board.d.ts","import":"./dist/board.mjs"},"./browser":"./dist/appboard.iife.js"},"gitHead":"275fbad483f9b491b38cb737f803c9dee22a9c04","scripts":{"build":"rm -rf dist && bun build src/index.ts --outfile dist/index.mjs --format esm --target browser && bun build src/board.ts --outfile dist/board.mjs --format esm --target browser && bun build src/iife.ts --outfile dist/appboard.iife.js --format iife --target browser && tsc --emitDeclarationOnly --outDir dist","prepare":"husky","typecheck":"tsc --noEmit","demo:build":"bun build src/iife.ts --outfile examples/appboard.iife.js --format iife --target browser","demo:serve":"bun --bun -e 'import { serve } from \"bun\"; serve({ port: 8080, fetch: (req) => { const path = new URL(req.url).pathname === \"/\" ? \"/demo.html\" : new URL(req.url).pathname; return new Response(Bun.file(`examples${path}`)); } }); console.log(\"http://localhost:8080\")'"},"_npmUser":{"name":"djokerg","email":"grebovicdjole@gmail.com"},"_npmVersion":"10.9.4","description":"Official Appboard SDK for embeddable onboarding boards","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.6.3","@commitlint/cli":"^19.6.1","@commitlint/config-conventional":"^19.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.3_1779180078992_0.0017382553357547792","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@appboard-ai/sdk","version":"0.1.0","keywords":["onboarding","app","customer","activation"],"author":{"name":"Appboard-AI"},"license":"ISC","_id":"@appboard-ai/sdk@0.1.0","maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"dist":{"shasum":"9b59984ca65d64c237fc89632ece97e777c6289a","tarball":"https://registry.npmjs.org/@appboard-ai/sdk/-/sdk-0.1.0.tgz","fileCount":12,"integrity":"sha512-Im3IMsaVYNmlJe1a8F61tm17ymXESOYzbVwEV0OLbDj8IWDTeX7zr7O8b6Pez/VbzMsORlkIJtSfMdN/TSjH2g==","signatures":[{"sig":"MEYCIQCWtD3vcl5DNFU9lXVHmcI+ntUnTwbMDGVQYoobdRCISAIhAL36yTkvaK9RUrsMbM9LA5VeOZvqSiPFthEvnTH4qkZW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49487},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs"},"./browser":"./dist/appboard.iife.js"},"gitHead":"6637524b3ddc6a2c64c07c604b1bd2c143951e14","scripts":{"build":"rm -rf dist && bun build src/index.ts --outfile dist/index.mjs --format esm --target browser && bun build src/iife.ts --outfile dist/appboard.iife.js --format iife --target browser && tsc --emitDeclarationOnly --outDir dist","prepare":"husky","typecheck":"tsc --noEmit","demo:build":"bun build src/iife.ts --outfile examples/appboard.iife.js --format iife --target browser","demo:serve":"bun --bun -e 'import { serve } from \"bun\"; serve({ port: 8080, fetch: (req) => { const path = new URL(req.url).pathname === \"/\" ? \"/demo.html\" : new URL(req.url).pathname; return new Response(Bun.file(`examples${path}`)); } }); console.log(\"http://localhost:8080\")'"},"_npmUser":{"name":"djokerg","email":"grebovicdjole@gmail.com"},"_npmVersion":"10.9.4","description":"Official Appboard SDK for embeddable onboarding boards","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.6.3","@commitlint/cli":"^19.6.1","@commitlint/config-conventional":"^19.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1779305213574_0.9910108999432392","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@appboard-ai/sdk","version":"0.1.1","description":"Official Appboard SDK for embeddable onboarding boards","type":"module","main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs"},"./browser":"./dist/appboard.iife.js"},"scripts":{"build":"rm -rf dist && bun build src/index.ts --outfile dist/index.mjs --format esm --target browser && bun build src/iife.ts --outfile dist/appboard.iife.js --format iife --target browser && tsc --emitDeclarationOnly --outDir dist","typecheck":"tsc --noEmit","demo:build":"bun build src/iife.ts --outfile examples/appboard.iife.js --format iife --target browser","demo:serve":"bun --bun -e 'import { serve } from \"bun\"; serve({ port: 8080, fetch: (req) => { const path = new URL(req.url).pathname === \"/\" ? \"/demo.html\" : new URL(req.url).pathname; return new Response(Bun.file(`examples${path}`)); } }); console.log(\"http://localhost:8080\")'","prepare":"husky"},"keywords":["onboarding","app","customer","activation"],"author":{"name":"Appboard-AI"},"license":"ISC","devDependencies":{"@commitlint/cli":"^19.6.1","@commitlint/config-conventional":"^19.6.0","husky":"^9.1.7","typescript":"^5.6.3"},"_id":"@appboard-ai/sdk@0.1.1","gitHead":"d053f97a1b4c4d962de1c5618ad3d47ec39865b6","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-ySmWUEAPSheSiRt6AGX14VV5X4wcNiNpsTy6Xd47mw3IoSDuWZ9Un5jpnzMzJR7rGsp1iY4z7LOIjP5hbnXLuA==","shasum":"5954cee310d351e3f2c40486238fd2d4c8c1940f","tarball":"https://registry.npmjs.org/@appboard-ai/sdk/-/sdk-0.1.1.tgz","fileCount":12,"unpackedSize":50209,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD8tiS+b0lT6y0aELp48Z8TPhoRGm4seqj4pV99oqGIFgIgey/KTBxoDL9keBNE3Fxe933U5zLc9pSEV74Du0j9KGA="}]},"_npmUser":{"name":"djokerg","email":"grebovicdjole@gmail.com"},"directories":{},"maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.1_1779564651384_0.21322479535703054"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T18:21:55.876Z","modified":"2026-05-23T19:30:51.672Z","0.0.1":"2026-05-07T18:21:56.109Z","0.0.2":"2026-05-11T13:08:56.507Z","0.0.3":"2026-05-19T08:41:19.135Z","0.1.0":"2026-05-20T19:26:53.763Z","0.1.1":"2026-05-23T19:30:51.514Z"},"author":{"name":"Appboard-AI"},"license":"ISC","keywords":["onboarding","app","customer","activation"],"description":"Official Appboard SDK for embeddable onboarding boards","maintainers":[{"name":"djokerg","email":"grebovicdjole@gmail.com"}],"readme":"# Appboard SDK\n\nOfficial browser SDK for [Appboard](https://appboard.ai). Customers install this in their app to identify end-users and track events; Appboard then matches those events against the goals & steps configured in their dashboard and reports activation progress back.\n\n> The SDK calls `https://api.appboard.ai/v1/*` by default. That URL is permanent — once shipped, customers will never upgrade.\n\n## Install\n\n```bash\nnpm install @appboard-ai/sdk\n```\n\n## Usage (npm / bundler)\n\n```ts\nimport { createAppboard } from \"@appboard-ai/sdk\";\n\nconst appboard = createAppboard({ projectKey: \"pk_...\" });\n\nawait appboard.identify(\"user_123\", { plan: \"pro\" });\nawait appboard.track(\"chart.created\", { source: \"templates\" });\n```\n\nEach `createAppboard(...)` call returns an independent instance — you can run multiple in the same page (e.g. multi-tenant hosts) without state collision.\n\n## Usage (script tag)\n\n```html\n<script src=\"https://unpkg.com/@appboard-ai/sdk/dist/appboard.iife.js\"></script>\n<script>\n  const appboard = window.Appboard.createAppboard({ projectKey: \"pk_...\" });\n  await appboard.identify(\"user_123\");\n  await appboard.track(\"chart.created\");\n</script>\n```\n\n## API\n\n```text\ncreateAppboard({ projectKey: string, apiUrl?: string }): AppboardClient\n\nAppboardClient.identify(userId: string, traits?: Record<string, JsonValue>): Promise<void>\nAppboardClient.track(eventName: string, props?: Record<string, JsonValue>): Promise<void>\nAppboardClient.getBoard(): Promise<Board>\n```\n\n`apiUrl` defaults to `https://api.appboard.ai`. Override only for local development.\n\n**Failure modes.**\n\n- `track()` called before `identify()` warns to the console and drops the event — never throws.\n- `getBoard()` throws on network errors or if `identify()` hasn't been called. Callers wrap in `try/catch`.\n- The optional `renderBoard()` helper (see below) catches both and always renders something.\n\n### Board UI (optional)\n\nTwo rendering modes share the same panel. Both ship from the main package entry — tracking-only integrations pay nothing for the UI code thanks to tree-shaking (`sideEffects: false`).\n\n#### Launcher (recommended)\n\nA floating chip in one of four viewport corners; clicking it opens a panel with the activation checklist. Suited to long-lived dashboards where the board lives across pages.\n\n```ts\nimport { createAppboard, mountLauncher } from \"@appboard-ai/sdk\";\n\nconst appboard = createAppboard({ projectKey: \"pk_...\" });\nawait appboard.identify(\"user_123\");\n\nconst launcher = mountLauncher(appboard, {\n  position: \"bottom-right\",      // default; also \"bottom-left\" | \"top-right\" | \"top-left\"\n  label: \"Getting started\",      // chip label\n  defaultOpen: false,\n  hideWhenComplete: false,       // when true, chip auto-hides at 100%\n  theme: { primary: \"#ff5722\" }, // see \"Theming\" below\n});\n\n// After track(): launcher.refresh() to re-fetch progress.\nawait appboard.track(\"note.created\");\nawait launcher.refresh();\n\n// Imperative control if you need it:\nlauncher.open();\nlauncher.close();\nlauncher.toggle();\nlauncher.destroy();              // remove from DOM\n```\n\nThe launcher is anchored to `document.body` with `position: fixed`. Only one instance can exist at a time — calling `mountLauncher` again destroys the previous mount and replaces it. Outside-click and `Escape` close the open panel.\n\n#### Inline board\n\nFor when you want the checklist embedded in a specific spot in your own UI (e.g. a dedicated \"Getting started\" page).\n\n```ts\nimport { renderBoard } from \"@appboard-ai/sdk\";\n\nawait renderBoard(appboard, \"#appboard-board\");\n```\n\n```html\n<div id=\"appboard-board\"></div>\n```\n\n`renderBoard` is async. It fetches the current end-user's goals + step completions and renders into the host element via Shadow DOM. Always renders something (empty state on any failure) — never throws. Calling again on the same element re-renders.\n\n#### Both modes — script tag\n\n```html\n<script src=\"https://unpkg.com/@appboard-ai/sdk/dist/appboard.iife.js\"></script>\n<script>\n  const { createAppboard, mountLauncher, renderBoard } = window.Appboard;\n  const appboard = createAppboard({ projectKey: \"pk_...\" });\n  await appboard.identify(\"user_123\");\n  const launcher = mountLauncher(appboard);\n  // — or —\n  // await renderBoard(appboard, \"#appboard-board\");\n</script>\n```\n\n#### Headless mode\n\nSkip both renderers and render your own UI on top of the raw data:\n\n```ts\nconst board = await appboard.getBoard();\n// board.goals[].steps[].completed_at — render however you want\n```\n\n#### Theming\n\n**Launcher.** Pass a `theme` object to `mountLauncher`:\n\n```ts\nmountLauncher(appboard, {\n  theme: {\n    primary: \"#ff5722\",\n    radius: \"8px\",\n    chipBg: \"#111827\",\n    chipForeground: \"#ffffff\",\n  },\n});\n```\n\n**Inline.** Override CSS custom properties on the host element from your own stylesheet:\n\n```css\n#appboard-board {\n  --appboard-primary: #ff5722;\n  --appboard-radius: 6px;\n  --appboard-font: \"Inter\", sans-serif;\n}\n```\n\nAvailable custom properties: `--appboard-primary`, `--appboard-primary-foreground`, `--appboard-foreground`, `--appboard-muted`, `--appboard-border`, `--appboard-bg`, `--appboard-bg-soft`, `--appboard-radius`, `--appboard-font`, `--appboard-chip-bg`, `--appboard-chip-foreground`.\n\n## Local development\n\nRequires [Bun](https://bun.sh). The SDK uses `bun build` — no rollup/tsup/vite.\n\n```bash\nbun install\nbun run build         # → dist/index.mjs (core) + dist/board.mjs (UI) + dist/appboard.iife.js (browser global)\nbun run typecheck\n```\n\n### Demo page\n\nThe `examples/` folder has a tiny HTML page that calls `identify` / `track` / `renderBoard` against a running Appboard api so you can verify ingestion end-to-end.\n\n```bash\n# 1. In the appboard repo: start the api on :3000\n#    (cd /path/to/appboard && bun dev)\n# 2. Build the SDK bundle into examples/\nbun run demo:build\n# 3. Serve the demo\nbun run demo:serve     # → http://localhost:8080\n```\n\nOpen the page, paste a `pk_*` project key, click **Init** → **identify** → any track button, then watch the events appear in the dashboard's project events view (it polls every 5s).\n","readmeFilename":"README.md"}