{"_id":"@ciabosoftwaresolutions/capacitor-distribution-channel","_rev":"3-04581fd18054e5c9b4808550281898ea","name":"@ciabosoftwaresolutions/capacitor-distribution-channel","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@ciabosoftwaresolutions/capacitor-distribution-channel","version":"0.1.0","keywords":["capacitor","plugin","testflight","app-store","play-store","distribution","ios","android"],"author":{"name":"Ciabo Software Solutions"},"license":"MIT","_id":"@ciabosoftwaresolutions/capacitor-distribution-channel@0.1.0","maintainers":[{"name":"ciabosoftwaresolutions","email":"ciabosoftwaresolutions@gmail.com"}],"homepage":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel#readme","bugs":{"url":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel/issues"},"dist":{"shasum":"87a07b703aba211c4952f2c4df8fd628d4a90f64","tarball":"https://registry.npmjs.org/@ciabosoftwaresolutions/capacitor-distribution-channel/-/capacitor-distribution-channel-0.1.0.tgz","fileCount":23,"integrity":"sha512-rJdMaiFOcO/iYj4eYsiBx50snGQHbKMpATp3f5MlHi/vTdeOmNoK4077I/ZIZS64PmXZwMFaVwNQ8hFHJJyiww==","signatures":[{"sig":"MEUCIQDh7h8Sf7Vhj8z16dek+oM3o81D3ekCUx/OBLUCgRgaoQIgHEsx89Kthrd53ITGJnzBjXE11ZOJupfQ4lkF3XoH+2k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30989},"main":"dist/plugin.cjs.js","type":"module","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"2dd8a37654fd18e5361db8824908cdcd69ad903a","scripts":{"fmt":"prettier \"**/*.{css,html,ts,js,java}\" --write","lint":"eslint . --ext ts","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","docgen":"docgen --api DistributionChannelPlugin --project tsconfig.docgen.json --output-readme README.md --output-json dist/docs.json","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS build | xcpretty","verify:web":"npm run build","verify:android":"cd android && ./gradlew clean build test"},"_npmUser":{"name":"ciabosoftwaresolutions","email":"ciabosoftwaresolutions@gmail.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel.git","type":"git"},"_npmVersion":"11.12.1","description":"Capacitor plugin to detect how an app was installed — TestFlight vs App Store on iOS, Play Store vs sideloaded on Android.","directories":{},"_nodeVersion":"25.9.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rimraf":"^6.0.1","rollup":"^4.21.3","prettier":"^3.3.3","typescript":"^5.5.4","@capacitor/ios":"^8.4.0","@capacitor/core":"^8.4.0","@capacitor/docgen":"^0.3.1","@capacitor/android":"^8.4.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.4","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2"},"peerDependencies":{"@capacitor/core":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-distribution-channel_0.1.0_1784986389055_0.07452267142726621","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ciabosoftwaresolutions/capacitor-distribution-channel","version":"0.1.1","keywords":["capacitor","plugin","testflight","app-store","play-store","distribution","ios","android"],"author":{"name":"Ciabo Software Solutions"},"license":"MIT","_id":"@ciabosoftwaresolutions/capacitor-distribution-channel@0.1.1","maintainers":[{"name":"ciabosoftwaresolutions","email":"ciabosoftwaresolutions@gmail.com"}],"homepage":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel#readme","bugs":{"url":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel/issues"},"dist":{"shasum":"6625952ed31ea0be38f583c3eed9e9fd4442da36","tarball":"https://registry.npmjs.org/@ciabosoftwaresolutions/capacitor-distribution-channel/-/capacitor-distribution-channel-0.1.1.tgz","fileCount":23,"integrity":"sha512-hgaLhSkpjye2kPW2L1BrCzP/TlpnghtCbM9Z0zvTQGHsxcwSCprh/kTe6kLlaNbPJuvJO/swiSn/tEAIjVmuuw==","signatures":[{"sig":"MEUCIEFACST2kctGilaUKL9qV9x7EU/UpnSKeGx741WdKg72AiEAmfcPWTzicGOfnvrew4UZUAF2TByzV3yyOuyEWgV5Qq4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ciabosoftwaresolutions%2fcapacitor-distribution-channel@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31286},"main":"dist/plugin.cjs.js","type":"module","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"280a0ff36273fe4ea2c4bb39a2135d92cb4c28d7","scripts":{"fmt":"prettier \"**/*.{css,html,ts,js,java}\" --write","lint":"eslint . --ext ts","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","docgen":"docgen --api DistributionChannelPlugin --project tsconfig.docgen.json --output-readme README.md --output-json dist/docs.json","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS build | xcpretty","verify:web":"npm run build","verify:android":"cd android && ./gradlew clean build test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:46a5986f-d681-4154-9383-9c7110820acd"}},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin to detect how an app was installed — TestFlight vs App Store on iOS, Play Store vs sideloaded on Android.","directories":{},"_nodeVersion":"24.18.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rimraf":"^6.0.1","rollup":"^4.21.3","prettier":"^3.3.3","typescript":"^5.5.4","@capacitor/ios":"^8.4.0","@capacitor/core":"^8.4.0","@capacitor/docgen":"^0.3.1","@capacitor/android":"^8.4.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.4","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2"},"peerDependencies":{"@capacitor/core":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-distribution-channel_0.1.1_1784988362751_0.9116575259593744","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@ciabosoftwaresolutions/capacitor-distribution-channel","version":"0.1.2","description":"Capacitor plugin to detect how an app was installed — TestFlight vs App Store on iOS, Play Store vs sideloaded on Android.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","type":"module","author":{"name":"Ciabo Software Solutions"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel.git"},"bugs":{"url":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel/issues"},"homepage":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel#readme","keywords":["capacitor","plugin","testflight","app-store","play-store","distribution","ios","android"],"scripts":{"build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","docgen":"docgen --api DistributionChannelPlugin --project tsconfig.docgen.json --output-readme README.md --output-json dist/docs.json","lint":"eslint . --ext ts","fmt":"prettier \"**/*.{css,html,ts,js,java}\" --write","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS build | xcpretty","verify:android":"cd android && ./gradlew clean build test","verify:web":"npm run build"},"devDependencies":{"@capacitor/android":"^8.4.0","@capacitor/core":"^8.4.0","@capacitor/docgen":"^0.3.1","@capacitor/ios":"^8.4.0","@ionic/eslint-config":"^0.4.0","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2","eslint":"^8.57.0","prettier":"^3.3.3","prettier-plugin-java":"^2.6.4","rimraf":"^6.0.1","rollup":"^4.21.3","typescript":"^5.5.4"},"peerDependencies":{"@capacitor/core":"^8.0.0"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","prettier":"@ionic/prettier-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"gitHead":"938ffc762ba7bf284eafa64fb0cce07d3ae9188a","_id":"@ciabosoftwaresolutions/capacitor-distribution-channel@0.1.2","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-FNsVhUzbOYAbxgNAd89C4hwbj5vl0mj+Ba4KRuIVJkL9s4FkX3mLwcDXPnCp7c5MnzvCQROvjp6B2fky1a0tXg==","shasum":"85c13f6572e9918b3eb2df736c82a6e60b922dbb","tarball":"https://registry.npmjs.org/@ciabosoftwaresolutions/capacitor-distribution-channel/-/capacitor-distribution-channel-0.1.2.tgz","fileCount":23,"unpackedSize":31330,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ciabosoftwaresolutions%2fcapacitor-distribution-channel@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDWZec0oc1JE84DF86mP8HAuKh6bYk5269ZgMS14PqvIgIgGoeJcrgZ8i4BCmsCpoAYwYDQHgYfQoIRC+RhJ95Ciak="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:46a5986f-d681-4154-9383-9c7110820acd"}},"directories":{},"maintainers":[{"name":"ciabosoftwaresolutions","email":"ciabosoftwaresolutions@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-distribution-channel_0.1.2_1784990081915_0.1374215760217099"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-25T13:33:08.887Z","modified":"2026-07-25T14:34:42.355Z","0.1.0":"2026-07-25T13:33:09.192Z","0.1.1":"2026-07-25T14:06:02.878Z","0.1.2":"2026-07-25T14:34:42.048Z"},"bugs":{"url":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel/issues"},"author":{"name":"Ciabo Software Solutions"},"license":"MIT","homepage":"https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel#readme","keywords":["capacitor","plugin","testflight","app-store","play-store","distribution","ios","android"],"repository":{"type":"git","url":"git+https://github.com/ciabosoftwaresolutions/capacitor-distribution-channel.git"},"description":"Capacitor plugin to detect how an app was installed — TestFlight vs App Store on iOS, Play Store vs sideloaded on Android.","maintainers":[{"name":"ciabosoftwaresolutions","email":"ciabosoftwaresolutions@gmail.com"}],"readme":"# @ciabosoftwaresolutions/capacitor-distribution-channel\n\nCapacitor plugin to detect how an app was installed — **TestFlight vs App Store** on iOS, **Play Store vs sideloaded** on Android. One line of code, zero native setup.\n\n[![npm version](https://img.shields.io/npm/v/@ciabosoftwaresolutions/capacitor-distribution-channel)](https://www.npmjs.com/package/@ciabosoftwaresolutions/capacitor-distribution-channel)\n[![npm downloads](https://img.shields.io/npm/dm/@ciabosoftwaresolutions/capacitor-distribution-channel)](https://www.npmjs.com/package/@ciabosoftwaresolutions/capacitor-distribution-channel)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nIf this plugin saves you time, consider buying us a coffee ☕\n\n[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow?logo=buy-me-a-coffee&logoColor=white)](https://buymeacoffee.com/ciabosoftwaresolutions)\n\n---\n\n## Why\n\nA single build can't dynamically re-point itself at a different backend — the usual approach is building separate dev/prod variants and remembering which one to archive for TestFlight vs the App Store. That's fine, but it's manual, and it's easy to accidentally ship the wrong one.\n\niOS actually gives you a real, Apple-documented way to tell TestFlight and App Store installs apart at runtime: the app's **receipt file path**. This plugin exposes that check, plus the closest equivalent on Android.\n\n```typescript\nimport { DistributionChannel } from '@ciabosoftwaresolutions/capacitor-distribution-channel';\n\nconst { channel } = await DistributionChannel.getDistributionChannel();\n// channel === 'testflight' | 'appstore' | 'development' | 'playstore' | 'sideload' | 'web' | 'unknown'\n```\n\n---\n\n## Platform support\n\n| | iOS | Android |\n|---|---|---|\n| Detection basis | App receipt path (`Bundle.main.appStoreReceiptURL`) | Install source (`PackageManager` install-source info) |\n| Distinguishes | TestFlight vs App Store vs local Xcode Debug run | Google Play vs sideloaded — **not** which Play track |\n| Accuracy | Exact — this is Apple's own documented signal | Partial — Play Store doesn't expose which release track (internal/closed/open/production) an install came from, so `playstore` covers all of them |\n| Native setup required | None | None |\n\n**Read that last row carefully for Android**: `playstore` does **not** mean \"production.\" It means \"Google Play was the installer,\" which is true for every testing track too. There is no Android API that tells you which track an app was installed from. If you need dev/prod switching on Android, you still need separate build variants — this plugin can't help there, and doesn't pretend to.\n\n---\n\n## How it works\n\nThere's no server call, no configuration, and no native project changes on either platform — the values are read directly from OS-level signals already present on the device.\n\n```\niOS      App launch  ──▶  Bundle.main.appStoreReceiptURL  ──▶  'testflight' | 'appstore' | 'development'\nAndroid  App launch  ──▶  PackageManager install-source    ──▶  'playstore' | 'sideload'\n```\n\n| Value | Platform | Meaning |\n|---|---|---|\n| `testflight` | iOS | Installed via TestFlight (`sandboxReceipt`). |\n| `appstore` | iOS | Installed via the App Store — production. |\n| `development` | iOS | Running directly from Xcode (Debug configuration). |\n| `playstore` | Android | Installed via Google Play — any release track. |\n| `sideload` | Android | Installed by anything other than Google Play (adb, a third-party store, a manually distributed APK). |\n| `web` | Both | Running as a plain website, not inside a native shell. |\n| `unknown` | iOS | No receipt present (rare — e.g. certain jailbreak/tamper scenarios). |\n\n---\n\n## Requirements\n\n| Tool | Minimum version |\n|---|---|\n| Capacitor | 8.0 |\n| iOS deployment target | 13.0 |\n| Android `minSdkVersion` | 23 |\n| Node | 18+ |\n\n## Installation\n\n```bash\nnpm install @ciabosoftwaresolutions/capacitor-distribution-channel\nnpx cap sync\n```\n\nThat's it — no Xcode capabilities, no `Info.plist` keys, no `AndroidManifest.xml` permissions, no `build.gradle` edits. The plugin auto-registers on both platforms.\n\n---\n\n## Usage\n\nThe most common use case — pick a backend at launch:\n\n```typescript\nimport { DistributionChannel } from '@ciabosoftwaresolutions/capacitor-distribution-channel';\n\nconst { channel } = await DistributionChannel.getDistributionChannel();\n\nswitch (channel) {\n  case 'testflight':\n  case 'development':\n    // point at your dev/staging backend\n    setApiBaseUrl('https://api-dev.yourapp.com');\n    break;\n  case 'appstore':\n    // point at production\n    setApiBaseUrl('https://api.yourapp.com');\n    break;\n  case 'playstore':\n  case 'sideload':\n    // Android: pick your build-time-configured environment as usual —\n    // this plugin cannot tell testing tracks from production here.\n    setApiBaseUrl(environment.apiBaseUrl);\n    break;\n  case 'web':\n  case 'unknown':\n  default:\n    setApiBaseUrl(environment.apiBaseUrl);\n    break;\n}\n```\n\nOther common uses: gating verbose logging / debug menus to non-production installs, tagging crash reports and analytics events with the install channel, or showing a \"you're on the beta build\" banner to TestFlight testers.\n\n---\n\n## API\n\n<docgen-index>\n\n* [`getDistributionChannel()`](#getdistributionchannel)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### getDistributionChannel()\n\n```typescript\ngetDistributionChannel() => any\n```\n\nReturns how this app was installed.\n\niOS detection is based on the app's receipt file\n(`Bundle.main.appStoreReceiptURL`) — Apple's own documented signal for\ndistinguishing a TestFlight install (`sandboxReceipt`) from a real App\nStore install (`receipt`). Builds run directly from Xcode are reported\nas `development` rather than `testflight`, since a Debug build also\ncarries a sandbox receipt path but was never actually distributed.\n\nAndroid detection is based on `PackageManager`'s install-source info,\nwhich can only tell you whether Google Play was the installer — it\ncannot tell you which release track. See <a href=\"#distributionchannel\">DistributionChannel</a> for details\non what each returned value means.\n\n**Returns:** <code>any</code>\n\n--------------------\n\n\n### Interfaces\n\n\n#### DistributionChannelResult\n\n| Prop          | Type                                                                |\n| ------------- | ------------------------------------------------------------------- |\n| **`channel`** | <code><a href=\"#distributionchannel\">DistributionChannel</a></code> |\n\n\n### Type Aliases\n\n\n#### DistributionChannel\n\nHow the app was installed/distributed.\n\n- `testflight` — iOS, installed via TestFlight.\n- `appstore` — iOS, installed via the App Store (production).\n- `development` — iOS, running directly from Xcode (Debug configuration).\n- `playstore` — Android, installed via Google Play. This covers every\n  release track (internal, closed, open, production) — Google Play does\n  not expose which track an install came from, so there is no Android\n  equivalent to the iOS `testflight` vs `appstore` distinction.\n- `sideload` — Android, installed by any means other than Google Play\n  (adb install, a third-party store, a manually distributed APK, etc).\n- `web` — running as a plain website, not inside a native shell.\n- `unknown` — unable to determine (e.g. no receipt present on iOS).\n\n<code>'testflight' | 'appstore' | 'development' | 'playstore' | 'sideload' | 'web' | 'unknown'</code>\n\n</docgen-api>\n\n---\n\n## FAQ\n\n### Why does a TestFlight build show `development` in my Simulator?\n\nThe Simulator and local Xcode Debug runs are always reported as `development`, regardless of how the archive would ultimately be distributed — `#if DEBUG` is checked before the receipt is ever inspected. To see real `testflight` / `appstore` values you need a **Release** build installed through TestFlight or the App Store, on a physical device.\n\n### Can I tell internal testing apart from production on Android?\n\nNo — and no Capacitor or native plugin can. Google Play's `PackageManager` install-source API only reports the installer package (`com.android.vending`), not which release track served the install. If you need that distinction, use separate Android build variants/flavors configured at build time instead.\n\n### Does this require network access?\n\nNo. Everything is read locally from the OS — no request is made, so it works offline and returns instantly.\n\n---\n\n## Contributing\n\nPRs welcome! Please open an issue first for non-trivial changes.\n\n```bash\nnpm install\nnpm run build\n```\n\nBefore submitting a PR, run the platform verify scripts (requires Xcode/CocoaPods for iOS, Android SDK for Android):\n\n```bash\nnpm run verify:web      # build\nnpm run verify:ios      # pod install + xcodebuild\nnpm run verify:android  # gradlew build + test\nnpm run verify          # all three\n```\n\n---\n\n## Support\n\nIf this plugin helped you ship faster, consider buying us a coffee — it helps keep the project maintained and free for everyone. ☕\n\n[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-yellow?logo=buy-me-a-coffee&logoColor=white)](https://buymeacoffee.com/ciabosoftwaresolutions)\n\n---\n\n## License\n\nMIT © [Ciabo Software Solutions](https://github.com/ciabosoftwaresolutions)\n","readmeFilename":"README.md"}