{"_id":"@appspacer/expo","name":"@appspacer/expo","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@appspacer/expo","version":"1.0.0","description":"AppSpacer OTA asset updates and crash reporting for Expo managed workflow","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.build.json","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"keywords":["expo","ota","appspacer","over-the-air","asset-updates"],"license":"MIT","author":{"name":"AppSpacer"},"homepage":"https://appspacer.com","peerDependencies":{"expo":">=50.0.0","expo-application":">=5.0.0","expo-crypto":">=13.0.0","expo-device":">=6.0.0","expo-file-system":">=17.0.0","expo-network":">=6.0.0","react-native":">=0.73.0"},"devDependencies":{"@vitest/coverage-v8":"^4.1.7","typescript":"^5.0.0","vitest":"^4.1.7"},"gitHead":"2aa069f2d7b3aed1e244dd126ee87167b427b8f7","_id":"@appspacer/expo@1.0.0","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-pVe0NVxkRaovGqoorPwy1dAumtK3IjQWhKI9zG7WGwd41jsKsF03NXnRz123WXIjo7ZsIrLoJqEbrJbHTM1CIQ==","shasum":"67dc2e46537ba5e98bf41aa46df00a887342ed11","tarball":"https://registry.npmjs.org/@appspacer/expo/-/expo-1.0.0.tgz","fileCount":31,"unpackedSize":68229,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDdLnW7vozF7DEwLXeLqtQXL+oUOkEm5gZfniAjBiEZ+wIgCUYEzVEp8OmwmxHY4JkDuPiYS6YN9TB0WtTQBRH3VUU="}]},"_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/expo_1.0.0_1782287950723_0.2414853346462651"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-24T07:59:10.577Z","1.0.0":"2026-06-24T07:59:10.852Z","modified":"2026-06-24T07:59:11.070Z"},"maintainers":[{"name":"appspacer","email":"dev.appspacer@gmail.com"}],"description":"AppSpacer OTA asset updates and crash reporting for Expo managed workflow","homepage":"https://appspacer.com","keywords":["expo","ota","appspacer","over-the-air","asset-updates"],"author":{"name":"AppSpacer"},"license":"MIT","readme":"# @appspacer/expo\n\n**Over-The-Air (OTA) asset updates and crash reporting for the Expo managed workflow.**\n\nThe Expo SDK delivers **assets** (JSON, images, content files) — not JavaScript code. It downloads the bundle you publish from AppSpacer, verifies its checksum, caches it, and exposes the contents in-app via `readAssetJson` / `readAssetString` / `readAssetBytes`. It also includes a lightweight crash reporter with breadcrumbs.\n\nPush 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\nnpx expo install @appspacer/expo\n```\n\nInstall the required Expo peer modules if your project doesn't already have them:\n\n```bash\nnpx expo install expo-application expo-crypto expo-device expo-file-system expo-network\n```\n\n**Requirements:** Expo SDK 50+, React Native 0.73+.\n\n---\n\n## Quick Start\n\nInitialize the SDK once at app startup:\n\n```ts\nimport { AppSpacer } from '@appspacer/expo';\n\nawait AppSpacer.init({\n  apiKey: 'your-deployment-key',\n  // appVersion is auto-detected from the native build if omitted\n});\n\n// Read content delivered over the air (key matches the published asset).\nconst config = await AppSpacer.readAssetJson('bundle.zip');\n```\n\nBy default (`updateStrategy: 'onInit'`) the SDK checks for and downloads updates during `init()`.\n\n---\n\n## Publishing an update\n\nPublish an asset file with the CLI:\n\n```bash\n# Android — publish a remote config file\nappspacer release-expo -p android -a my-app -d Production -f ./remote-config.json\n\n# iOS — mandatory content update with explicit version\nappspacer release-expo -p ios -a my-app -d Production -f ./content.json -t 1.2.0 --mandatory\n```\n\n---\n\n## Configuration\n\n```ts\ninterface AppSpacerConfig {\n  apiKey: string;                                       // Deployment key from your dashboard\n  appVersion?: string;                                  // Defaults to the native app version\n  serverUrl?: string;                                   // Self-hosted API base URL. Default: https://api.appspacer.com/api\n  debugLogging?: boolean;                               // Default: false\n  updateStrategy?: 'onInit' | 'background' | 'manual';  // When to check for updates. Default: 'onInit'\n  maxBreadcrumbs?: number;                              // Default: 50\n  crashReportingEnabled?: boolean;                      // Default: true\n}\n```\n\n`updateStrategy`:\n- `onInit` — check and `await` the update during `init()`.\n- `background` — check during `init()` without blocking startup.\n- `manual` — never check automatically; call `AppSpacer.checkForUpdates()` yourself.\n\n---\n\n## API\n\n### Updates\n\n| Method | Description |\n|--------|-------------|\n| `AppSpacer.init({ apiKey, config? })` | Initialize the SDK. Call once before anything else. |\n| `AppSpacer.checkForUpdates()` | Manually check for, download, and apply asset updates. Returns an `OtaUpdateResult`. |\n| `AppSpacer.readAssetJson(key)` | Read a downloaded asset as parsed JSON, or `null`. |\n| `AppSpacer.readAssetString(key)` | Read a downloaded asset as a string, or `null`. |\n| `AppSpacer.readAssetBytes(key)` | Read a downloaded asset as `Uint8Array`, or `null`. |\n| `AppSpacer.activeBundleInfo()` | Metadata about the currently active bundle. |\n| `AppSpacer.cacheSize()` | Total size of cached assets in bytes. |\n| `AppSpacer.clearAssetCache()` | Remove all cached assets. |\n| `AppSpacer.reset()` | Tear down the SDK instance. |\n\n### Crash reporting\n\n| Method | Description |\n|--------|-------------|\n| `AppSpacer.reportError(error, opts?)` | Manually report an error with optional `stackTrace`, `context`, and `extra`. |\n| `AppSpacer.addBreadcrumb(message, category?, data?, level?)` | Record a breadcrumb leading up to a crash. |\n| `AppSpacer.clearBreadcrumbs()` | Clear recorded breadcrumbs. |\n| `AppSpacer.sessionId` | Current session id. |\n| `AppSpacer.pendingCrashCount` | Number of crashes queued for delivery. |\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","_rev":"1-9ad96a46c79e51d4f721c2e1d9f4eaa0"}