{"_id":"@bonko/template-sdk","_rev":"4-b9040d6ddccae321db5a4d1fb6985d9f","name":"@bonko/template-sdk","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.2":{"name":"@bonko/template-sdk","version":"0.2.2","license":"UNLICENSED","_id":"@bonko/template-sdk@0.2.2","maintainers":[{"name":"ranen1024","email":"ranen1024@gmail.com"}],"homepage":"https://github.com/bonkofun/template-sdk#readme","bugs":{"url":"https://github.com/bonkofun/template-sdk/issues"},"dist":{"shasum":"2d31fdd513935777d0f7a1a33a936a607882fa50","tarball":"https://registry.npmjs.org/@bonko/template-sdk/-/template-sdk-0.2.2.tgz","fileCount":36,"integrity":"sha512-HJQZRFMcavZy74h/COlnP7Mu5a6Z6cHTGiBKGWO4YQ64SkLRXEb7kkDfYKCfHsXjmSAc5TI197H1uVh+V7Fvwg==","signatures":[{"sig":"MEQCIFsm3SH52KwN3RcynnQ7pv5AEWEBKOvRupgtqO3IHQ/EAiBhIyiIx8PAY5GqAe7D0LorTOxdXRveq8bGCsRdmvc1nA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":131520},"type":"module","_from":"file:artifacts/bonko-template-sdk-0.2.2.tgz","engines":{"node":">=22.12.0"},"exports":{".":"./dist/index.js","./node":"./dist/node.js","./react":"./dist/react.js","./submission":"./dist/submission.js","./runtime-host":"./dist/runtime-host.js","./runtime-react":"./dist/runtime-react.js","./runtime-assets":"./dist/runtime-assets.js","./runtime-bundle":"./dist/runtime-bundle.js","./runtime-client":"./dist/runtime-client.js","./runtime-gateway":"./dist/runtime-gateway.js","./runtime-document":"./dist/runtime-document.js","./runtime-messages":"./dist/runtime-messages.js"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","package:check":"node scripts/check-package.mjs"},"_npmUser":{"name":"ranen1024","email":"ranen1024@gmail.com"},"_resolved":"/Users/ranen/workspace/sass/template-sdk/artifacts/bonko-template-sdk-0.2.2.tgz","_integrity":"sha512-HJQZRFMcavZy74h/COlnP7Mu5a6Z6cHTGiBKGWO4YQ64SkLRXEb7kkDfYKCfHsXjmSAc5TI197H1uVh+V7Fvwg==","repository":{"url":"git+https://github.com/bonkofun/template-sdk.git","type":"git"},"_npmVersion":"11.14.0","description":"Shared versioned SDK for Bonko template authoring, validation and isolated browser runtime.","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"react":"19.2.8","motion":"13.1.1","vitest":"4.1.11","typescript":"5.7.3","@types/node":"22.13.0","@types/react":"19.2.18"},"peerDependencies":{"react":"19.2.8","motion":"13.1.1"},"_npmOperationalInternal":{"tmp":"tmp/template-sdk_0.2.2_1788667624555_0.7201771499289811","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@bonko/template-sdk","version":"0.2.3","license":"MIT","_id":"@bonko/template-sdk@0.2.3","maintainers":[{"name":"ranen1024","email":"ranen1024@gmail.com"}],"homepage":"https://github.com/bonkofun/template-sdk#readme","bugs":{"url":"https://github.com/bonkofun/template-sdk/issues"},"dist":{"shasum":"0d580833665944cabe14818dba9ef0e9ecc76ac6","tarball":"https://registry.npmjs.org/@bonko/template-sdk/-/template-sdk-0.2.3.tgz","fileCount":37,"integrity":"sha512-oRP8FmUGkBE3H53LKp5+u2ixzElTYS6aUrhVO07o5gCYmQWsLrTq6rmm2DEWvnemoKCZYmumnuhxbq/14FBFrA==","signatures":[{"sig":"MEQCIDbVHE6MLK7AgVjApxn2ILemO6QVmBasUHoL20DqK4QkAiAqE3VPpRqhgshwKh6YuKY6chgL99IsoGthm1KY00vqgw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bonko%2ftemplate-sdk@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":120781},"type":"module","_from":"file:artifacts/bonko-template-sdk-0.2.3.tgz","engines":{"node":">=22.12.0"},"exports":{".":"./dist/index.js","./node":"./dist/packaging/node.js","./react":"./dist/react/react.js","./submission":"./dist/protocol/submission.js","./runtime-host":"./dist/runtime/runtime-host.js","./runtime-react":"./dist/react/runtime-react.js","./runtime-assets":"./dist/runtime/runtime-assets.js","./runtime-bundle":"./dist/packaging/runtime-bundle.js","./runtime-client":"./dist/runtime/runtime-client.js","./runtime-gateway":"./dist/gateway/runtime-gateway.js","./runtime-document":"./dist/gateway/runtime-document.js","./runtime-messages":"./dist/protocol/runtime-messages.js"},"scripts":{"test":"vitest run","build":"node scripts/build.mjs","typecheck":"tsc -p tsconfig.json --noEmit","package:check":"node scripts/check-package.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e0c048f7-d39c-4a79-8103-cd67fafd06a9"}},"_resolved":"/home/runner/work/template-sdk/template-sdk/artifacts/bonko-template-sdk-0.2.3.tgz","_integrity":"sha512-oRP8FmUGkBE3H53LKp5+u2ixzElTYS6aUrhVO07o5gCYmQWsLrTq6rmm2DEWvnemoKCZYmumnuhxbq/14FBFrA==","repository":{"url":"git+https://github.com/bonkofun/template-sdk.git","type":"git"},"_npmVersion":"11.14.0","description":"Shared versioned SDK for Bonko template authoring, validation and isolated browser runtime.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"react":"19.2.8","motion":"13.1.1","vitest":"4.1.11","typescript":"5.7.3","@types/node":"22.13.0","@types/react":"19.2.18"},"peerDependencies":{"react":"19.2.8","motion":"13.1.1"},"_npmOperationalInternal":{"tmp":"tmp/template-sdk_0.2.3_1788669182417_0.016779572563955014","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@bonko/template-sdk","version":"0.2.4","license":"MIT","_id":"@bonko/template-sdk@0.2.4","maintainers":[{"name":"ranen1024","email":"ranen1024@gmail.com"}],"homepage":"https://github.com/bonkofun/template-sdk#readme","bugs":{"url":"https://github.com/bonkofun/template-sdk/issues"},"dist":{"shasum":"ba83afb6055336cf1ed895e2c88a0ffdd90066a2","tarball":"https://registry.npmjs.org/@bonko/template-sdk/-/template-sdk-0.2.4.tgz","fileCount":37,"integrity":"sha512-eSpdwS21b+Gybe3hXLmE3eMS/WGyuJM42jMAxknlFDmO/nK7tM7ZQIpdBz0xFRL0XUYk1tH8nqrXYu/qFe5ZyQ==","signatures":[{"sig":"MEYCIQCRKPcU2kKn1zkSEb/r+RYQU3IsSFVhCVwQ3cCYCi/iQgIhAIsqjY8Iowc9i6Dpggq8HaeUzyWdjHTBWhidP+PwN/fu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bonko%2ftemplate-sdk@0.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":121343},"type":"module","_from":"file:artifacts/bonko-template-sdk-0.2.4.tgz","engines":{"node":">=22.12.0"},"exports":{".":"./dist/index.js","./node":"./dist/packaging/node.js","./react":"./dist/react/react.js","./submission":"./dist/protocol/submission.js","./runtime-host":"./dist/runtime/runtime-host.js","./runtime-react":"./dist/react/runtime-react.js","./runtime-assets":"./dist/runtime/runtime-assets.js","./runtime-bundle":"./dist/packaging/runtime-bundle.js","./runtime-client":"./dist/runtime/runtime-client.js","./runtime-gateway":"./dist/gateway/runtime-gateway.js","./runtime-document":"./dist/gateway/runtime-document.js","./runtime-messages":"./dist/protocol/runtime-messages.js"},"scripts":{"test":"vitest run","build":"node scripts/build.mjs","typecheck":"tsc -p tsconfig.json --noEmit","package:check":"node scripts/check-package.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e0c048f7-d39c-4a79-8103-cd67fafd06a9"}},"_resolved":"/home/runner/work/template-sdk/template-sdk/artifacts/bonko-template-sdk-0.2.4.tgz","_integrity":"sha512-eSpdwS21b+Gybe3hXLmE3eMS/WGyuJM42jMAxknlFDmO/nK7tM7ZQIpdBz0xFRL0XUYk1tH8nqrXYu/qFe5ZyQ==","repository":{"url":"git+https://github.com/bonkofun/template-sdk.git","type":"git"},"_npmVersion":"11.14.0","description":"Shared versioned SDK for Bonko template authoring, validation and isolated browser runtime.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"react":"19.2.8","motion":"13.1.1","vitest":"4.1.11","typescript":"5.7.3","@types/node":"22.13.0","@types/react":"19.2.18"},"peerDependencies":{"react":"19.2.8","motion":"13.1.1"},"_npmOperationalInternal":{"tmp":"tmp/template-sdk_0.2.4_1788748683225_0.43320911862171885","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@bonko/template-sdk@0.3.0","bugs":{"url":"https://github.com/bonkofun/template-sdk/issues"},"dist":{"shasum":"0cf5056f96880ae795fb65aafc0634354dba6dd4","tarball":"https://registry.npmjs.org/@bonko/template-sdk/-/template-sdk-0.3.0.tgz","fileCount":39,"integrity":"sha512-4bYQbszIMMKGk3XAPdnhwRzfHVaTPwO9TbyK6VaXTnOQWy/MPaoQOilqJWAqXnYINZjFYF6f+ON73f1jB66UdA==","signatures":[{"sig":"MEUCIErlmgDxWMW+fedxZxnfkWprK0e6EXIKd4m9ABuaWrnBAiEA6WH9jdiKHFGknUn5DBSTwA9LszvVXSOuB+n9OVeXwUI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDD0mvG9EXS/AKj03EChKvlhFMuzZ4H/vWIgxIRqF+m5AIgex7TFo6ZbEGI4kGwGVD2Rf4aTUquv5DVSFu9U5J36KM="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bonko%2ftemplate-sdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":132380},"name":"@bonko/template-sdk","type":"module","_from":"file:artifacts/bonko-template-sdk-0.3.0.tgz","engines":{"node":">=22.12.0"},"exports":{".":"./dist/index.js","./node":"./dist/packaging/node.js","./media":"./dist/protocol/media.js","./react":"./dist/react/react.js","./submission":"./dist/protocol/submission.js","./runtime-host":"./dist/runtime/runtime-host.js","./runtime-react":"./dist/react/runtime-react.js","./runtime-assets":"./dist/runtime/runtime-assets.js","./runtime-bundle":"./dist/packaging/runtime-bundle.js","./runtime-client":"./dist/runtime/runtime-client.js","./runtime-gateway":"./dist/gateway/runtime-gateway.js","./runtime-document":"./dist/gateway/runtime-document.js","./runtime-messages":"./dist/protocol/runtime-messages.js"},"license":"MIT","scripts":{"test":"vitest run","build":"node scripts/build.mjs","typecheck":"tsc -p tsconfig.json --noEmit","package:check":"node scripts/check-package.mjs"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e0c048f7-d39c-4a79-8103-cd67fafd06a9"}},"homepage":"https://github.com/bonkofun/template-sdk#readme","_resolved":"/home/runner/work/template-sdk/template-sdk/artifacts/bonko-template-sdk-0.3.0.tgz","_integrity":"sha512-4bYQbszIMMKGk3XAPdnhwRzfHVaTPwO9TbyK6VaXTnOQWy/MPaoQOilqJWAqXnYINZjFYF6f+ON73f1jB66UdA==","repository":{"url":"git+https://github.com/bonkofun/template-sdk.git","type":"git"},"_npmVersion":"11.14.0","description":"Shared versioned SDK for Bonko template authoring, validation and isolated browser runtime.","directories":{},"maintainers":[{"name":"ranen1024","email":"ranen1024@gmail.com"}],"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"react":"19.2.8","motion":"13.1.1","vitest":"4.1.11","typescript":"5.7.3","@types/node":"22.13.0","@types/react":"19.2.18"},"peerDependencies":{"react":"19.2.8","motion":"13.1.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/template-sdk_0.3.0_1790143521736_0.48140961789337067"}}},"time":{"created":"2026-09-06T04:07:04.238Z","modified":"2026-09-23T06:05:22.300Z","0.2.2":"2026-09-06T04:07:04.691Z","0.2.3":"2026-09-06T04:33:02.553Z","0.2.4":"2026-09-07T02:38:03.367Z","0.3.0":"2026-09-23T06:05:21.852Z"},"bugs":{"url":"https://github.com/bonkofun/template-sdk/issues"},"license":"MIT","homepage":"https://github.com/bonkofun/template-sdk#readme","repository":{"url":"git+https://github.com/bonkofun/template-sdk.git","type":"git"},"description":"Shared versioned SDK for Bonko template authoring, validation and isolated browser runtime.","maintainers":[{"name":"ranen1024","email":"ranen1024@gmail.com"}],"readme":"<h1 align=\"center\">Bonko Template SDK</h1>\n<p align=\"center\"><strong>Versioned template contracts, package validation, and isolated browser runtime for Bonko.</strong></p>\n<p align=\"center\">\n  <a href=\"https://github.com/bonkofun/template-sdk/actions/workflows/ci.yml\"><img src=\"https://github.com/bonkofun/template-sdk/actions/workflows/ci.yml/badge.svg\" alt=\"CI status\" /></a>\n  <a href=\"https://github.com/bonkofun/template-sdk/actions/workflows/release.yml\"><img src=\"https://github.com/bonkofun/template-sdk/actions/workflows/release.yml/badge.svg?event=push\" alt=\"Release status\" /></a>\n  <img src=\"https://img.shields.io/badge/SDK-0.2.4-E8A0B5?style=flat\" alt=\"SDK 0.2.4\" />\n  <img src=\"https://img.shields.io/badge/TypeScript-5.7.3-3178C6?style=flat\" alt=\"TypeScript 5.7.3\" />\n  <img src=\"https://img.shields.io/badge/Node.js-22.12.0-339933?style=flat\" alt=\"Node.js 22.12.0\" />\n</p>\n\nShared TypeScript contracts, package validation, and browser runtime for Bonko templates. Used by the Bonko application and [Template Studio](https://github.com/bonkofun/template-studio).\n\n## Install\n\n```bash\nnpm install @bonko/template-sdk\n```\n\nOr with pnpm:\n\n```bash\npnpm add @bonko/template-sdk\n```\n\nRequires Node.js **22.12.0+**. React **19.2.8** and Motion **13.1.1** are peer dependencies. The package includes compiled JavaScript and TypeScript declarations.\n\n## Use\n\nRegister a template inside a Bonko isolated runtime. This minimal example displays the recipient's name and message:\n\n```typescript\nimport { connectStandaloneTemplate } from '@bonko/template-sdk/runtime-client';\n\nconst root = document.createElement('main');\ndocument.body.append(root);\n\nconnectStandaloneTemplate({\n  render({ content }) {\n    root.textContent = `${content.recipientName}: ${content.message}`;\n  },\n  renderStatic({ content }) {\n    root.textContent = `${content.recipientName}: ${content.message}`;\n    return () => root.replaceChildren();\n  },\n  dispose() {\n    root.replaceChildren();\n  },\n});\n```\n\nThe client requires a Bonko host iframe; it does not run as a standalone page. Use [Template Studio](https://github.com/bonkofun/template-studio) to create, preview, and package complete templates. Interactive templates must handle playback state and report completion.\n\n| Import | Use |\n| --- | --- |\n| `@bonko/template-sdk/runtime-client` | Template registration and lifecycle |\n| `@bonko/template-sdk/runtime-react` | React host integration |\n| `@bonko/template-sdk/runtime-bundle` | Template package creation and validation |\n| `@bonko/template-sdk/runtime-gateway` | Isolated runtime gateway |\n\nSDK **0.2.3** supports Template Protocol **v3** with manifest `sdkVersion: \"0.2.0\"`.\n\n## License\n\n[MIT](LICENSE) © 2026 Bonko contributors.\n\n### Natural completion\n\nThe React RuntimeFrame keeps the live final frame mounted when playback completes\nnaturally. It does not hide the iframe or request a second static rendering.\nTemplates must settle into a readable result before calling `runtime.complete()`.\nAuthored static rendering remains required for previews, skip, and reduced motion.\n\n## Cinematic contract (0.3.0)\n\nPackage 0.3.0 accepts both manifest SDK contracts 0.2.0 and 0.3.0 with protocol 3.\nOpt into `sdkVersion: \"0.3.0\"` and capability `video` for flat `assets/*.mp4` files.\nSupported movies have exactly one silent H.264 track, at most 30 seconds, a\n1920px maximum edge, 2,073,600 pixels and 60fps. The shared parser validates\nbounded container/sample metadata; browser playback checks remain necessary.\nAudio stays separate (MP3/OGG, up to 30 seconds for this contract). Existing\n0.2.0 templates retain the ten-second audio limit and cannot declare videos.\n\nUse `runtime.asset(id)` for the muted, inline video and\n`runtime.audio.sync?.(audioId, positionMs)` for its soundtrack. Report the current\nclock regularly; the host owns permission, mute, pause, backgrounding and replay.\nStop media and frame callbacks on pause/dispose; provide a complete static entry.\nThe runtime gateway enables blob media only for a trusted stored document whose\n`video` flag was derived from the validated manifest. Remote media stays blocked.\n\nRoll out the SDK, CLI, Admin, main-site host and runtime Worker together before\npublishing cinematic inventory. Installing this package does not deploy consumers.\n","readmeFilename":"README.md"}