{"_id":"@decennium/booapp-sdk","_rev":"3-47a48620070106cfdf71c0ed9ce6ddb9","name":"@decennium/booapp-sdk","dist-tags":{"latest":"0.6.1"},"versions":{"0.1.0":{"name":"@decennium/booapp-sdk","version":"0.1.0","keywords":["decennium","peqaboo","booapp","sdk","types","typescript","pet","webview","bridge"],"license":"MIT","_id":"@decennium/booapp-sdk@0.1.0","maintainers":[{"name":"peqaboo","email":"simon@decennium.app"}],"homepage":"https://peqaboo.com/developer","bugs":{"url":"https://github.com/decennium/booapp/issues"},"dist":{"shasum":"b5a4310f664613bbba4e21da7a0daaf0e9c09c48","tarball":"https://registry.npmjs.org/@decennium/booapp-sdk/-/booapp-sdk-0.1.0.tgz","fileCount":10,"integrity":"sha512-R63i/eJQiN6/5xTUZKEHfK4UYz/UJWOy0yS+oKxQqhUJ2JKny1Rfgwb5obkmcmDqyP4tbae8VtSU0RxE75TUfA==","signatures":[{"sig":"MEUCIENmsg5USj98kqpQKeF2hpBnOV9JeWlg0xS6KM8s+qNRAiEA3601Q8TBCDKQ9KgqgjC4ok8sHhQOAP/6W5vL2CHwSQk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29371},"types":"./dist/index.d.ts","engines":{"node":">=18"},"gitHead":"7539c13c6abe11d1cdfe25710d49d85f5eee4b45","scripts":{"build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"peqaboo","email":"simon@decennium.app"},"repository":{"url":"git+https://github.com/decennium/booapp.git","type":"git"},"_npmVersion":"11.6.0","description":"TypeScript types for the BooApp SDK. The peqaboo runtime is auto-injected into BooApp WebViews; this package provides ambient types for autocomplete and type-checking.","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/booapp-sdk_0.1.0_1777899971487_0.3223491267805705","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@decennium/booapp-sdk","version":"0.4.0","keywords":["decennium","peqaboo","booapp","sdk","types","typescript","pet","webview","bridge"],"license":"MIT","_id":"@decennium/booapp-sdk@0.4.0","maintainers":[{"name":"peqaboo","email":"simon@decennium.app"}],"homepage":"https://peqaboo.com/developer","bugs":{"url":"https://github.com/decennium/booapp/issues"},"dist":{"shasum":"1ad857c6a2a099eeff5faf81ec67f4650563026d","tarball":"https://registry.npmjs.org/@decennium/booapp-sdk/-/booapp-sdk-0.4.0.tgz","fileCount":10,"integrity":"sha512-7UH9KRgEUL8/zetmv8BnpwR2qxBEKTb5SmMe1CusETBV8MoqdUzo3EK7ZIKIQl03AIJ8eH/BvLVDOiz7EZb7wA==","signatures":[{"sig":"MEYCIQCyXnk1SgswD1uWo3yrMA79qzHE+f57OhXLef363+4UawIhAJl9a76nKC9KECJSlhaNrI0xp0emzi6rl7/7qoYYc3SW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47640},"types":"./dist/index.d.ts","engines":{"node":">=18"},"gitHead":"ff3deef64222fdbf2e1b6eead377f9ec1d1e727e","scripts":{"build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"peqaboo","email":"simon@decennium.app"},"repository":{"url":"git+https://github.com/decennium/booapp.git","type":"git"},"_npmVersion":"11.6.0","description":"TypeScript types for the BooApp SDK. The peqaboo runtime is auto-injected into BooApp WebViews; this package provides ambient types for autocomplete and type-checking.","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/booapp-sdk_0.4.0_1778573297873_0.8340443535196767","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@decennium/booapp-sdk","version":"0.6.1","description":"TypeScript types for the BooApp SDK. The peqaboo runtime is auto-injected into BooApp WebViews; this package provides ambient types for autocomplete and type-checking.","license":"MIT","types":"./dist/index.d.ts","sideEffects":false,"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/decennium/booapp.git"},"homepage":"https://peqaboo.com/developer","bugs":{"url":"https://github.com/decennium/booapp/issues"},"keywords":["decennium","peqaboo","booapp","sdk","types","typescript","pet","webview","bridge"],"scripts":{"build":"tsc","clean":"rm -rf dist"},"devDependencies":{"typescript":"^5.4.0"},"publishConfig":{"access":"public"},"_id":"@decennium/booapp-sdk@0.6.1","gitHead":"ff3deef64222fdbf2e1b6eead377f9ec1d1e727e","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-Q0E/M7ky/YZlX7UDR+PtCCbLWByND2bGNUp4GoNxa9CX37NwWrGstXNx3B6MJ4eVrZ84waNXYAEiPBStuhXdOw==","shasum":"02a122f7d5137acddae94dc0227f10d39d44596b","tarball":"https://registry.npmjs.org/@decennium/booapp-sdk/-/booapp-sdk-0.6.1.tgz","fileCount":10,"unpackedSize":58492,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCEPZYuFf2QwCToebeD8uSkHV0jQCRojGro919shFNVzQIhAPUcAhMN+TC1UQUXT5zIglZX3xdksCd+tB3vIMx5M3pT"}]},"_npmUser":{"name":"peqaboo","email":"simon@decennium.app"},"directories":{},"maintainers":[{"name":"peqaboo","email":"simon@decennium.app"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/booapp-sdk_0.6.1_1778863141058_0.5287512884601908"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T13:06:11.361Z","modified":"2026-05-15T16:39:01.463Z","0.1.0":"2026-05-04T13:06:11.647Z","0.4.0":"2026-05-12T08:08:18.012Z","0.6.1":"2026-05-15T16:39:01.305Z"},"bugs":{"url":"https://github.com/decennium/booapp/issues"},"license":"MIT","homepage":"https://peqaboo.com/developer","keywords":["decennium","peqaboo","booapp","sdk","types","typescript","pet","webview","bridge"],"repository":{"type":"git","url":"git+https://github.com/decennium/booapp.git"},"description":"TypeScript types for the BooApp SDK. The peqaboo runtime is auto-injected into BooApp WebViews; this package provides ambient types for autocomplete and type-checking.","maintainers":[{"name":"peqaboo","email":"simon@decennium.app"}],"readme":"# @decennium/booapp-sdk\n\nTypeScript types for the **Peqaboo BooApp SDK**.\n\nBooApps run inside Peqaboo's WebView runtime, where the `peqaboo` global is\n**auto-injected** at `document_start`. You do **not** need to install any\nruntime package — this types-only package exists purely so TypeScript users\nget autocomplete, signature help, and compile-time checking.\n\n## Install\n\n```bash\nnpm i -D @decennium/booapp-sdk\n```\n\n(or `pnpm add -D @decennium/booapp-sdk`, `yarn add -D @decennium/booapp-sdk`,\n`bun add -d @decennium/booapp-sdk`.)\n\n## Usage\n\nAdd a triple-slash reference at the top of any source file (or a global\n`.d.ts` in your project) to make the `peqaboo` global ambient:\n\n```ts\n/// <reference types=\"@decennium/booapp-sdk\" />\n\nawait peqaboo.ready();\n\nif (!peqaboo.isInApp) {\n  // Running outside the Peqaboo WebView (plain browser preview).\n  return;\n}\n\nconst user = await peqaboo.requireLogin();\nconst pets = await peqaboo.pet.list();\nconsole.log(`Hello ${user.userName}, you have ${pets.length} pet(s).`);\n```\n\nYou can also reach the same object via `window.peqaboo`:\n\n```ts\n/// <reference types=\"@decennium/booapp-sdk\" />\n\nwindow.peqaboo.device.haptic('light');\n```\n\n### Inspect and write NFC\n\n```ts\nconst card = await peqaboo.device.inspectNfcTag({\n  url: 'https://peqaboo.app/view-pet-profile/pet-id',\n});\n\nif (card.canWritePeqabooUrl) {\n  await peqaboo.device.writeNfcUrl(\n    'https://peqaboo.app/view-pet-profile/pet-id'\n  );\n}\n```\n\n## Examples\n\n### Pick an image and upload it\n\n```ts\nconst file = await peqaboo.media.pickImage({ source: 'camera', quality: 85 });\nconst url = await peqaboo.storage.upload(file, { folder: 'user-uploads' });\nconsole.log('Uploaded to', url);\n```\n\n### Request a payment\n\n```ts\nconst result = await peqaboo.payment.request({\n  amount: 49,\n  currency: 'HKD',\n  description: 'NFC pet card',\n});\n\nif (result.status === 'succeeded') {\n  console.log('Paid:', result.transactionId);\n}\n```\n\n### Subscribe to lifecycle events\n\n```ts\nconst unsubscribe = peqaboo.on('appResume', () => {\n  refreshData();\n});\n\n// later\nunsubscribe();\n```\n\n### Open another BooApp\n\n```ts\nawait peqaboo.openBooApp('pet-loyalty-card', { from: 'home' });\n```\n\n## What's covered\n\n- **Lifecycle**: `ready()`, `isInApp`, `platform`, `bridgeVersion`, `sdkVersion`, `lang`, `uid`, `appId`\n- **Auth**: `requireLogin()`\n- **Pets**: `pet.list()`, `pet.read()`, `pet.update()`\n- **Media**: `media.pickImage()`, `media.pickVideo()`, `media.takePhoto()`\n- **Storage**: `storage.upload()`\n- **Location**: `location.getCurrent()`, `location.subscribe()`\n- **Payment**: `payment.request()`\n- **Notification**: `notification.send()`\n- **Chat**: `chat.openWith()`\n- **Device**: `device.share()`, `device.haptic()`, `device.scanCode()`, `device.inspectNfcTag()`, `device.writeNfcUrl()`\n- **Inter-app**: `openBooApp()`\n- **Events**: `on()` for `authTokenRefreshed`, `appResume`, `appPause`, `pushReceived`, `nfcTagDetected`, `keyboardShow`, `keyboardHide`\n\n## Permissions\n\nEach Bridge Action maps to a Permission Scope (e.g. `pet.list`, `media.pickImage`,\n`payment.request`). Declare every scope you call in your manifest's\n`permissions` array — the runtime enforces it. See the `PermissionScope` type\nin this package for the full whitelist with risk-tier and group annotations.\n\n## Notes\n\n- This package contains **only `.d.ts` files** — zero runtime, zero side effects.\n- The actual SDK is injected by the Peqaboo WebView host; you cannot use it in a plain browser tab.\n- For local previews, check `peqaboo.isInApp` before calling SDK methods.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}