{"_id":"@applaudiq/embed-cordova","_rev":"3-d3d943088e30711cf41a6f8bb6960b5e","name":"@applaudiq/embed-cordova","dist-tags":{"latest":"1.3.0"},"versions":{"1.1.1":{"name":"@applaudiq/embed-cordova","version":"1.1.1","keywords":["cordova","phonegap","ionic","applaudiq","embed","sso","recognition","webview"],"author":{"name":"Arulraj V","email":"abofficial1997@gmail.com"},"license":"MIT","_id":"@applaudiq/embed-cordova@1.1.1","maintainers":[{"name":"arul_thereward_store","email":"arulraj@vananam.com"}],"homepage":"https://github.com/therewardstore/applaudiq-embed-cordova#readme","bugs":{"url":"https://github.com/therewardstore/applaudiq-embed-cordova/issues"},"dist":{"shasum":"b87b4b3f3846f96a3ce3f08c7894e4c4f0baf901","tarball":"https://registry.npmjs.org/@applaudiq/embed-cordova/-/embed-cordova-1.1.1.tgz","fileCount":9,"integrity":"sha512-51110FVrbb/WO6sxNBau7fzyIx4g7456UVUAAkSGGPwO7tCjA2Tw8rzyN1Z9fGJwq50NGHdkNXnevmnI4UGviA==","signatures":[{"sig":"MEUCIEgI+iSmaizY1ScHc+Rnpy7dzzauAokxXe9ayxBxqB0NAiEA7zNLOs4MD7882V0YE0662sPOxA2fXgviL2gcR/LVCsM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71957},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","source":"src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"41c0ab82519f1484a81b18ef725a3de7f64ea6c2","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","clean":"rm -rf dist","prepare":"tsup src/index.ts --format esm,cjs --dts --clean","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arul_thereward_store","email":"arulraj@vananam.com"},"repository":{"url":"git+https://github.com/therewardstore/applaudiq-embed-cordova.git","type":"git"},"_npmVersion":"10.9.2","description":"Cordova / PhoneGap SDK to embed the Applaud IQ recognition portal (auto + manual login, native SSO). Works with plain Cordova and legacy Ionic React/Angular/Vue on Cordova.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","release-it":"^17.10.0","typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/embed-cordova_1.1.1_1782373060983_0.842728670426631","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@applaudiq/embed-cordova","version":"1.2.0","keywords":["cordova","phonegap","ionic","applaudiq","embed","sso","recognition","webview"],"author":{"name":"Arulraj V","email":"abofficial1997@gmail.com"},"license":"MIT","_id":"@applaudiq/embed-cordova@1.2.0","maintainers":[{"name":"arul_thereward_store","email":"arulraj@vananam.com"}],"homepage":"https://github.com/therewardstore/applaudiq-embed-cordova#readme","bugs":{"url":"https://github.com/therewardstore/applaudiq-embed-cordova/issues"},"dist":{"shasum":"f92b6f5bbcd1795a68d4209521f16519c70686ec","tarball":"https://registry.npmjs.org/@applaudiq/embed-cordova/-/embed-cordova-1.2.0.tgz","fileCount":9,"integrity":"sha512-eJTc24hOPe0NeNq2yE0aBARixknf87PEh7QWc6oIeOrByZ7RNQH/oNgV/3aymOKZHEZMJoIMm7UpLl9TpTCFrA==","signatures":[{"sig":"MEQCIH6ZzU8FpHRNPfsjhr+Yh9LfJxrTFPzHS3n/IBFpZZXGAiAuOhSbIBqNNI4ycVxxHrftAMlVkt7c4X4H9kmaW2zmoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73537},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","source":"src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"3f96e2c9926791249dd2a405185774ee84c80102","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","clean":"rm -rf dist","prepare":"tsup src/index.ts --format esm,cjs --dts --clean","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arul_thereward_store","email":"arulraj@vananam.com"},"repository":{"url":"git+https://github.com/therewardstore/applaudiq-embed-cordova.git","type":"git"},"_npmVersion":"10.9.2","description":"Cordova / PhoneGap SDK to embed the Applaud IQ recognition portal (auto + manual login, native SSO). Works with plain Cordova and legacy Ionic React/Angular/Vue on Cordova.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","release-it":"^17.10.0","typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/embed-cordova_1.2.0_1782991233168_0.762457659400088","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@applaudiq/embed-cordova","version":"1.3.0","description":"Cordova / PhoneGap SDK to embed the Applaud IQ recognition portal (auto + manual login, native SSO). Works with plain Cordova and legacy Ionic React/Angular/Vue on Cordova.","type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"source":"src/index.ts","scripts":{"clean":"rm -rf dist","build":"tsup src/index.ts --format esm,cjs --dts --clean","prepare":"tsup src/index.ts --format esm,cjs --dts --clean","typecheck":"tsc --noEmit","release":"release-it"},"publishConfig":{"access":"public"},"keywords":["cordova","phonegap","ionic","applaudiq","embed","sso","recognition","webview"],"repository":{"type":"git","url":"git+https://github.com/therewardstore/applaudiq-embed-cordova.git"},"homepage":"https://github.com/therewardstore/applaudiq-embed-cordova#readme","bugs":{"url":"https://github.com/therewardstore/applaudiq-embed-cordova/issues"},"author":{"name":"Arulraj V","email":"abofficial1997@gmail.com"},"license":"MIT","devDependencies":{"release-it":"^17.10.0","tsup":"^8.0.0","typescript":"^5.4.0"},"_id":"@applaudiq/embed-cordova@1.3.0","gitHead":"6e97329e2747e07284b88b1cf9f092f2293a3ae9","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-yDsCnkTZNti16vv96EMEG/ZY+Tw+spkkw4pSTrbZJP7Dt/I3p1VUdKvEcTvB8tneHWiwM57dAMIaIVSVKLiE6w==","shasum":"409a354eef00b06c824bfc6778a3b38f762ab643","tarball":"https://registry.npmjs.org/@applaudiq/embed-cordova/-/embed-cordova-1.3.0.tgz","fileCount":9,"unpackedSize":84241,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD+IbLVTXuND4hIsyHId5o58fD2Vu4OYMbdk2EJCgwMAwIhAP09M6mExy8QS6+LbkU+2GbH0e58tJB+pUvKg7LO/4Eu"}]},"_npmUser":{"name":"arul_thereward_store","email":"arulraj@vananam.com"},"directories":{},"maintainers":[{"name":"arul_thereward_store","email":"arulraj@vananam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/embed-cordova_1.3.0_1783099602268_0.42803906276630466"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T07:37:40.863Z","modified":"2026-07-03T17:26:42.564Z","1.1.1":"2026-06-25T07:37:41.119Z","1.2.0":"2026-07-02T11:20:33.331Z","1.3.0":"2026-07-03T17:26:42.419Z"},"bugs":{"url":"https://github.com/therewardstore/applaudiq-embed-cordova/issues"},"author":{"name":"Arulraj V","email":"abofficial1997@gmail.com"},"license":"MIT","homepage":"https://github.com/therewardstore/applaudiq-embed-cordova#readme","keywords":["cordova","phonegap","ionic","applaudiq","embed","sso","recognition","webview"],"repository":{"type":"git","url":"git+https://github.com/therewardstore/applaudiq-embed-cordova.git"},"description":"Cordova / PhoneGap SDK to embed the Applaud IQ recognition portal (auto + manual login, native SSO). Works with plain Cordova and legacy Ionic React/Angular/Vue on Cordova.","maintainers":[{"name":"arul_thereward_store","email":"arulraj@vananam.com"}],"readme":"# @applaudiq/embed-cordova\n\n[![npm](https://img.shields.io/npm/v/@applaudiq/embed-cordova.svg)](https://www.npmjs.com/package/@applaudiq/embed-cordova)\n\nEmbed the full **Applaud IQ** recognition portal inside a **Cordova / PhoneGap** app — plain Cordova or\n**legacy Ionic React / Angular / Vue on Cordova** — with **auto-login** (a one-time token minted by your server)\nor **manual login** (the portal's own email / SSO). The portal renders in an `<iframe>`; **SSO** and the\nAndroid **Back** button go through Cordova's native plugins.\n\n- Behavioral **parity with `@applaudiq/embed-capacitor`** — same `ApplaudIQ.init().open()` API, the same iframe +\n  postMessage bridge, the same SSO + Back flow. Only the native layer differs (Cordova plugins).\n- **Auto + manual login**, the **HR-approval gate**, and native **SSO** (Google / Microsoft).\n- Required Cordova plugins: `cordova-plugin-inappbrowser`, `cordova-plugin-customurlscheme`.\n\n> **New app?** Use [`@applaudiq/embed-capacitor`](https://www.npmjs.com/package/@applaudiq/embed-capacitor) —\n> Capacitor is the modern successor to Cordova (and the path for new Ionic apps). This package exists for\n> **existing** Cordova / PhoneGap / legacy-Ionic-Cordova apps.\n\n---\n\n## 1. Install\n\n```bash\nnpm install @applaudiq/embed-cordova@^1.3.0\ncordova plugin add cordova-plugin-inappbrowser cordova-plugin-customurlscheme\n```\n\n`cordova-plugin-inappbrowser` opens SSO in the system browser; `cordova-plugin-customurlscheme` delivers the SSO\ncallback deep link to `window.handleOpenURL`. (`backbutton` + `deviceready` are Cordova core — no extra plugin.)\n\n## 2. Register your SSO callback scheme\n\nSSO opens in the system browser and the backend hands the one-time code back to **your app's** deep link. Pick a\nscheme **unique to your app** (not the brand-wide `applaudiq://`) and declare it in **`config.xml`** — Cordova\ngenerates the native iOS `CFBundleURLSchemes` + Android intent-filter from it:\n\n```xml\n<!-- config.xml -->\n<!-- cordova-plugin-customurlscheme registers the scheme on both platforms -->\n<plugin name=\"cordova-plugin-customurlscheme\" spec=\"^5.0.2\">\n  <variable name=\"URL_SCHEME\" value=\"myapp\" />\n</plugin>\n```\n\nPass it as `ssoCallback` (the SDK sends it to the backend as `native_redirect`). Default `applaudiq://sso-callback`.\n\n## 3. Render the embed\n\n**Manual login** — just the publishable key:\n\n```ts\nimport { ApplaudIQ } from '@applaudiq/embed-cordova';\n\nApplaudIQ.init({ key: 'pk_live_…', ssoCallback: 'myapp://sso-callback' })\n  .open({ mode: 'manual', render: 'fullscreen' });\n```\n\n**Auto-login** — a one-time token your backend minted (`POST /api/v1/embed/sessions`):\n\n```ts\nconst embed = ApplaudIQ.init({ key: 'pk_live_…', ssoCallback: 'myapp://sso-callback' }).open({\n  mode: 'auto',\n  token: embedToken,\n  render: 'fullscreen',\n  onReady: () => {},        // signed in\n  onAuthPending: () => {},  // awaiting HR approval\n  onError: (m) => {},       // failed (incl. SSO ?error=)\n  onClose: () => {},        // dismissed\n});\n// later: embed.close();\n```\n\n> Call `open()` after Cordova's `deviceready` event (so the plugins are loaded) — typically from a button tap,\n> which always fires after launch.\n\n## 4. Options\n\n| Option | |\n|---|---|\n| `config.key` | Publishable key (`pk_live_…`). Required, both modes. |\n| `config.baseUrl` | Portal origin. Defaults to the production portal. **HTTPS** in production. |\n| `config.ssoCallback` | Your app's `scheme://host` deep link (default `applaudiq://sso-callback`); sent as `native_redirect`. |\n| `config.backNavigation` | `true` (default): **Android** hardware Back + **iOS** left-edge swipe step back inside the embed (`onClose` at the root). `false`: platform default, no iOS swipe. See [Back navigation](#back-navigation). |\n| `mode` | `'auto'` (needs `token`) or `'manual'` (portal login). |\n| `render` | `'fullscreen'` (default) · `'modal'` · `'inline'` (needs `container`). |\n| callbacks | `onReady` · `onAuthPending` · `onError(message)` · `onClose` · `onSignOut`. |\n\n## Back navigation\n\nThe portal renders in a **cross-origin iframe**, so the SDK can't read its history directly. With\n`backNavigation` on (the default), it relays a back request to the portal, which steps back through its own\nscreens and replies only when it's already at the embed root — then the SDK tears the embed down and fires\n`onClose`. Route home in `onClose`:\n\n- **Android** — the hardware Back button (Cordova's `backbutton` event).\n- **iOS** — a **left-edge swipe** (iOS has no hardware Back, and the WebView's own swipe-back can't traverse the\n  iframe). The gesture lives in the leftmost ~20px of the embed.\n\n```ts\n.open({\n  mode: 'manual',\n  onClose: () => { location.hash = '#/'; },   // dismissed at the embed root → go Home\n});\n```\n\n## How SSO works\n\n`mode: 'manual'` shows the portal's email / SSO login inside the embed. SSO can't run in a WebView, so the SDK\nopens the IdP in the **system browser** (`cordova-plugin-inappbrowser` `open(url, '_system')`) at\n`…/auth/sso/{provider}/employee/authorize?native=1&native_redirect=<ssoCallback>`. The backend redirects the\none-time code to `<ssoCallback>?code=` (or `?error=`), `cordova-plugin-customurlscheme`'s `window.handleOpenURL`\ncatches it, and the SDK relays it into the embed, which redeems it and reloads — signed in.\n\n## Downloads & external links\n\nWhen the portal (or the reward store nested inside it) needs to open a URL outside the WebView —\na file download, a payment page, or an OAuth handoff — it sends the `applaudiq:open-external` bridge\nmessage with payload `{ url }`. The SDK opens `http(s)` URLs in the **system browser**\n(`cordova-plugin-inappbrowser` `open(url, '_system')`). No app code is required.\n\nThe reward store's **gift-card voucher download** additionally sends `applaudiq:save-file` with\n`{ base64, filename, mime }`. To enable it, add the two **optional** plugins to your app:\n\n```bash\ncordova plugin add cordova-plugin-file cordova-plugin-x-socialsharing\n```\n\nThe SDK writes the file to the app cache and opens the OS share sheet. Without these plugins, voucher\ndownloads are a silent no-op.\n\n## Test integration\n\nA runnable example ships for each framework in\n[`applaudiq-sdk-example`](https://github.com/therewardstore/applaudiq-sdk-example) under\n`native-integration/cordova/` (vanilla · react · angular · vue · ionic-react · ionic-angular · ionic-vue).\n\nLatest: **v1.3.0 (LTS)**. See [CHANGELOG.md](./CHANGELOG.md). MIT licensed.\n","readmeFilename":"README.md"}