{"_id":"@dg-superapp/bridge-adapter-example","_rev":"2-ad1d1f8f833daea571ff4b0e78867ddf","name":"@dg-superapp/bridge-adapter-example","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@dg-superapp/bridge-adapter-example","version":"0.2.0","keywords":["super-app","bridge","adapter","example","stub","educational"],"license":"MIT","_id":"@dg-superapp/bridge-adapter-example@0.2.0","maintainers":[{"name":"chantysothy","email":"chanty.sothy@gmail.com"}],"homepage":"https://github.com/dg-superapp/dg-superapp-bridge#readme","bugs":{"url":"https://github.com/dg-superapp/dg-superapp-bridge/issues"},"dist":{"shasum":"dd45b6a97e4981ccd609a5ee86a56c41d5549c9a","tarball":"https://registry.npmjs.org/@dg-superapp/bridge-adapter-example/-/bridge-adapter-example-0.2.0.tgz","fileCount":7,"integrity":"sha512-BW6iQ5NUom9bSYkO+P1b6or1SV0t0aVC7OjpNu987Yvg3QBmLK4dLlzGMifn5SEzqiMj1puUar1rZKa+3wTEpA==","signatures":[{"sig":"MEUCIQDbFhJnmTOSNNccsrX5hF+/CyQOOfvo/3oTbiviCuKNCgIgR1yC8oWkr97dLhEbQw+ED/pZNSg3IoY9jDrqCHjV9Xc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dg-superapp%2fbridge-adapter-example@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12779},"main":"./dist/index.cjs","type":"module","_from":"file:dg-superapp-bridge-adapter-example-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"test":"vitest run","build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chantysothy","email":"chanty.sothy@gmail.com"},"_resolved":"/tmp/606241a30a5c15917eb8780964bcfd14/dg-superapp-bridge-adapter-example-0.2.0.tgz","_integrity":"sha512-BW6iQ5NUom9bSYkO+P1b6or1SV0t0aVC7OjpNu987Yvg3QBmLK4dLlzGMifn5SEzqiMj1puUar1rZKa+3wTEpA==","repository":{"url":"git+https://github.com/dg-superapp/dg-superapp-bridge.git","type":"git","directory":"packages/adapter-example"},"_npmVersion":"10.8.2","description":"Educational stub adapter showing how to implement BridgeAdapter. NOT FOR PRODUCTION.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@dg-superapp/bridge-core":"1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"unbuild":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bridge-adapter-example_0.2.0_1776068588069_0.5996074208335149","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@dg-superapp/bridge-adapter-example","version":"0.2.1","description":"Educational stub adapter showing how to implement BridgeAdapter. NOT FOR PRODUCTION.","type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"dependencies":{"@dg-superapp/bridge-core":"1.0.1"},"devDependencies":{"unbuild":"^3.0.0"},"keywords":["super-app","bridge","adapter","example","stub","educational"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dg-superapp/dg-superapp-bridge.git","directory":"packages/adapter-example"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"sideEffects":false,"scripts":{"build":"unbuild","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@dg-superapp/bridge-adapter-example@0.2.1","bugs":{"url":"https://github.com/dg-superapp/dg-superapp-bridge/issues"},"homepage":"https://github.com/dg-superapp/dg-superapp-bridge#readme","_integrity":"sha512-FAqTocfMVFtt7dy8foAvKBNY19OE5nvlB/Lva6MIfe8bHn3vaNsWzXllQEpDl4W6M5u3ndpWoQpJIK6RwUWoww==","_resolved":"/tmp/471d45ceea1ae5732fcc90874a1d1749/dg-superapp-bridge-adapter-example-0.2.1.tgz","_from":"file:dg-superapp-bridge-adapter-example-0.2.1.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-FAqTocfMVFtt7dy8foAvKBNY19OE5nvlB/Lva6MIfe8bHn3vaNsWzXllQEpDl4W6M5u3ndpWoQpJIK6RwUWoww==","shasum":"d08bbc99cfc9b92ee4374ec5ad76b1f44dc9ca7c","tarball":"https://registry.npmjs.org/@dg-superapp/bridge-adapter-example/-/bridge-adapter-example-0.2.1.tgz","fileCount":7,"unpackedSize":12755,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrdKqlSf35i+02AADSWQdV1OJZIFrfmU3aIsgQfHoj+QIhANkroW7Go4SBvwB6Oa7GtJ8gRccubyL3IUgyb3i59TQa"}]},"_npmUser":{"name":"chantysothy","email":"chanty.sothy@gmail.com"},"directories":{},"maintainers":[{"name":"chantysothy","email":"chanty.sothy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bridge-adapter-example_0.2.1_1776473350652_0.060872058550752284"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-13T08:23:08.012Z","modified":"2026-04-18T00:49:10.952Z","0.2.0":"2026-04-13T08:23:08.204Z","0.2.1":"2026-04-18T00:49:10.786Z"},"bugs":{"url":"https://github.com/dg-superapp/dg-superapp-bridge/issues"},"license":"MIT","homepage":"https://github.com/dg-superapp/dg-superapp-bridge#readme","keywords":["super-app","bridge","adapter","example","stub","educational"],"repository":{"type":"git","url":"git+https://github.com/dg-superapp/dg-superapp-bridge.git","directory":"packages/adapter-example"},"description":"Educational stub adapter showing how to implement BridgeAdapter. NOT FOR PRODUCTION.","maintainers":[{"name":"chantysothy","email":"chanty.sothy@gmail.com"}],"readme":"# @dg-superapp/bridge-adapter-example\n\n> **EDUCATIONAL STUB — NOT FOR PRODUCTION USE.**\n>\n> This package is a minimal, in-memory reference implementation of the\n> `BridgeAdapter` contract. It exists solely to show public consumers\n> the shape of a working adapter. Every response is a hardcoded value\n> from an in-memory state object. There is no real backend, no HTTP,\n> no persistence, no retry, no observability, no telemetry.\n\n## What it does\n\nImplements `BridgeAdapter` from `@dg-superapp/bridge-core` with two\nhandler responses wired into `callHandler()`:\n\n- `userProfile` — returns a static \"Jane Example\" profile\n- `initializeMiniApp` — returns `{ os: \"example\" }`\n- everything else — returns a structured `UNSUPPORTED` failure\n\n`initialize()` and `dispose()` are no-ops.\n\n## What it is for\n\n- Reading as a **template** for your own adapter\n- Running in **unit tests** where you need a valid `BridgeAdapter` with\n  predictable responses\n- Demonstrating **handler dispatch** without pulling in WebView,\n  `flutter_inappwebview`, or any other platform-specific plumbing\n\n## What it is NOT for\n\n- Production traffic\n- Real user data\n- Anything that needs network I/O, persistence, encryption, or retry\n\nIf you are looking for a real adapter to model after, see\n[`packages/adapter-dg`](../adapter-dg) for a full production\nimplementation with WebView plumbing, error handling, timeout\nsemantics, and response normalization.\n\n## Usage\n\n```typescript\nimport { createExampleAdapter } from \"@dg-superapp/bridge-adapter-example\";\n\nconst adapter = createExampleAdapter();\nawait adapter.initialize();\n\nconst result = await adapter.callHandler(\"userProfile\", []);\nconsole.log(result);\n// { success: true, data: { userId: \"USER_0001\", ... }, message: \"OK\" }\n```\n\n## How to turn this into a real adapter\n\n1. Copy `src/ExampleAdapter.ts` into your own package.\n2. Replace the `SUPPORTED_HANDLERS` set and the `switch` in `callHandler()`\n   with calls into your real platform (native bridge, HTTP client,\n   WebView message channel, etc).\n3. Change `platformId` and `platformName` to match your platform.\n4. Register your adapter's factory via\n   [`registerAdapterImport()`](../sdk/src/adapters/lazy.ts) in a module\n   side-effect so the SDK can lazy-load it when your platform is detected.\n\n## License\n\nMIT — same as the parent monorepo.\n","readmeFilename":"README.md"}