{"_id":"@appspacer/capacitor","_rev":"2-688358128a349f8a163d2dbd7b5aa14b","name":"@appspacer/capacitor","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@appspacer/capacitor","version":"1.0.0","keywords":["capacitor","plugin","ota","appspacer","live-updates"],"author":{"name":"AppSpacer"},"license":"MIT","_id":"@appspacer/capacitor@1.0.0","maintainers":[{"name":"appspacer","email":"dev.appspacer@gmail.com"}],"homepage":"https://appspacer.com","dist":{"shasum":"0ff832e6b44220537bab5d0bdf83edaa9d6a76f8","tarball":"https://registry.npmjs.org/@appspacer/capacitor/-/capacitor-1.0.0.tgz","fileCount":24,"integrity":"sha512-K+E8aPx7d+FzhLryOq5uhiFIwxWiddBjGJHlIr0FgfkOuno+YzJkYITsiWW2rLpXxPI3XxQlxj9P+wtephqHAQ==","signatures":[{"sig":"MEQCIFHR5niK3RGbYXRBjI+41l2oivpiZ3eB0z9EoV97zxCiAiAfd/+27DfeU3/lzJMW0Pajo2/UKXrhe7YzvglPBOS4CQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45802},"main":"dist/cjs/index.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"d660255b1c3fee13b602b4c0e34cb001feee4214","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"appspacer","email":"dev.appspacer@gmail.com"},"_npmVersion":"11.6.1","description":"AppSpacer OTA live updates for Capacitor apps","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^29.1.1","vitest":"^4.1.7","typescript":"^5.0.0","@capacitor/core":"^6.0.0","@vitest/coverage-v8":"^4.1.7"},"peerDependencies":{"@capacitor/core":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor_1.0.0_1782287000711_0.0903325920141167","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@appspacer/capacitor","version":"1.0.1","description":"AppSpacer OTA live updates for Capacitor apps","main":"dist/cjs/index.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"keywords":["capacitor","plugin","ota","appspacer","live-updates"],"license":"MIT","author":{"name":"AppSpacer"},"homepage":"https://appspacer.com","peerDependencies":{"@capacitor/core":"^6.0.0"},"devDependencies":{"@capacitor/core":"^6.0.0","@vitest/coverage-v8":"^4.1.7","jsdom":"^29.1.1","typescript":"^5.0.0","vitest":"^4.1.7"},"gitHead":"d660255b1c3fee13b602b4c0e34cb001feee4214","_id":"@appspacer/capacitor@1.0.1","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-9+8JdA/lN2gJaSytBrdueAELnZxe0fOB/2vQ2bqRMmVs24cDK+h/PyRyHSVoZxXPFNOCuZvmbOYoIDgVgFDYqg==","shasum":"cd5e6ce5d3b71231fd6646738d17632c604e7f65","tarball":"https://registry.npmjs.org/@appspacer/capacitor/-/capacitor-1.0.1.tgz","fileCount":26,"unpackedSize":50182,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCewU/56jGumpTmaEDcH/hhNHLJV7yfsOnNuCYUGwW+PAIgZkM/o8ROK74to5afzqZe5Ej1AZhtIMiTkscXpKL/sac="}]},"_npmUser":{"name":"appspacer","email":"dev.appspacer@gmail.com"},"directories":{},"maintainers":[{"name":"appspacer","email":"dev.appspacer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor_1.0.1_1782287584502_0.5514394092371357"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-24T07:43:20.591Z","modified":"2026-06-24T07:53:04.776Z","1.0.0":"2026-06-24T07:43:20.841Z","1.0.1":"2026-06-24T07:53:04.638Z"},"author":{"name":"AppSpacer"},"license":"MIT","homepage":"https://appspacer.com","keywords":["capacitor","plugin","ota","appspacer","live-updates"],"description":"AppSpacer OTA live updates for Capacitor apps","maintainers":[{"name":"appspacer","email":"dev.appspacer@gmail.com"}],"readme":"# @appspacer/capacitor\n\n**Over-The-Air (OTA) live updates for Capacitor apps.** Ship JavaScript, HTML, and CSS changes to your web build instantly — no app store review required.\n\nThe plugin checks AppSpacer for a newer web bundle, verifies its SHA-256, unzips it, and serves your app from the updated bundle on the next launch. Push releases with the [AppSpacer CLI](https://www.npmjs.com/package/@appspacer/cli).\n\nFull documentation: [docs.appspacer.com](https://docs.appspacer.com)\n\n---\n\n## Installation\n\n```bash\nnpm install @appspacer/capacitor\nnpx cap sync\n```\n\n**Requirements:** Capacitor 6.\n\n---\n\n## Quick Start\n\nInitialize the SDK early in your app's startup (e.g. in your root component or `main.ts`), then sync:\n\n```ts\nimport { AppSpacer } from '@appspacer/capacitor';\n\nawait AppSpacer.init({\n  deploymentKey: 'your-deployment-key',\n  appVersion: '1.0.0',\n});\n\n// Check for, download, and apply an update in one call.\nconst result = await AppSpacer.sync();\nif (result.updateAvailable) {\n  console.log('Update applied:', result.label);\n}\n```\n\nAfter a bundle is downloaded and applied, call `AppSpacer.reload()` (or relaunch) to load it.\n\n---\n\n## Publishing an update\n\nBuild your web app, then push the output with the CLI:\n\n```bash\n# Android — auto-detects www/dist/build\nappspacer release-capacitor -p android -a my-app -d Production -t 1.0.0\n\n# iOS — explicit build directory, mandatory update\nappspacer release-capacitor -p ios -a my-app -d Production -t 1.0.0 --mandatory -f ./dist\n```\n\nZip the **contents** of the web build (with `index.html` at the top level). The plugin verifies the SHA-256, unzips the bundle, and serves it from the new path.\n\n---\n\n## API\n\n### `AppSpacer.init(config)`\n\nInitialize the plugin. Must be called before any other method.\n\n```ts\ninterface AppSpacerConfig {\n  deploymentKey: string;   // Deployment key from your AppSpacer dashboard\n  appVersion: string;      // The native app store version this build targets\n  serverUrl?: string;      // Override the API base URL (self-hosted). Default: https://api.appspacer.com/api\n  debugLogging?: boolean;  // Verbose logging. Default: false\n}\n```\n\n### `AppSpacer.sync(): Promise<UpdateCheckResult>`\n\nCheck for an update and, if one is available, download and apply it. Returns the check result.\n\n### `AppSpacer.checkForUpdate(): Promise<UpdateCheckResult>`\n\nCheck whether an update is available without downloading it.\n\n```ts\ninterface UpdateCheckResult {\n  updateAvailable: boolean;\n  releaseId?: string;\n  packageUrl?: string;\n  hash?: string;\n  mandatory?: boolean;\n  description?: string;\n  label?: string;\n  packageSize?: number;\n}\n```\n\n### `AppSpacer.reload(): Promise<void>`\n\nReload the WebView to load the most recently applied bundle.\n\n### `AppSpacer.resetToBuiltIn(): Promise<void>`\n\nDiscard any downloaded bundle and revert to the bundle shipped inside the binary.\n\n### `AppSpacer.getDeviceId(): Promise<{ deviceId: string }>`\n\nReturn the stable per-install device identifier used for staged rollouts.\n\n---\n\n## Links\n\n- **Dashboard:** [appspacer.com](https://appspacer.com)\n- **CLI:** [@appspacer/cli](https://www.npmjs.com/package/@appspacer/cli)\n- **Documentation:** [docs.appspacer.com](https://docs.appspacer.com)\n- **Support:** [appspacer.com/support](https://appspacer.com/support)\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}