{"id":18556309,"url":"https://github.com/maks-io/who-am-i-now","last_synced_at":"2026-04-07T20:01:30.154Z","repository":{"id":149972915,"uuid":"622541221","full_name":"maks-io/who-am-i-now","owner":"maks-io","description":"Platform detection: NodeJS? React? ReactNative? Expo? etc.","archived":false,"fork":false,"pushed_at":"2024-10-15T10:55:19.000Z","size":1448,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T04:44:53.000Z","etag":null,"topics":["detect","expo","nextjs","nodejs","platform-specific","react","react-native","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maks-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-02T12:28:52.000Z","updated_at":"2025-04-13T15:26:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"17c9b852-d24d-4614-b588-c606d9971aaa","html_url":"https://github.com/maks-io/who-am-i-now","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maks-io/who-am-i-now","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maks-io%2Fwho-am-i-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maks-io%2Fwho-am-i-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maks-io%2Fwho-am-i-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maks-io%2Fwho-am-i-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maks-io","download_url":"https://codeload.github.com/maks-io/who-am-i-now/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maks-io%2Fwho-am-i-now/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31526666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detect","expo","nextjs","nodejs","platform-specific","react","react-native","typescript"],"created_at":"2024-11-06T21:29:50.038Z","updated_at":"2026-04-07T20:01:30.143Z","avatar_url":"https://github.com/maks-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# who-am-i-now\n\n[![Version](https://img.shields.io/npm/v/who-am-i-now)](https://www.npmjs.com/package/who-am-i-now)\n\n\u003cimg alt=\"who-gif\" src=\"./documentation/who-gif.gif\" /\u003e\n\nWhich platform am I on?\n\nDo you need to run platform specific code?\n\nIf you need to (programmatically) find the answer to one of the following questions then this package is for you:\n\n- _\"is my app a **react** frontend?\"_\n- _\"is my app a **nextjs** app?\"_\n- _\"is my app a **PWA standalone** (installed) app?\"_\n- _\"is my app a **react-native** app?\"_\n- _\"is my app an **expo** app?\"_\n- _\"is my react-native or expo app running on **ios**, **android** or **web**?\"_\n- _\"is my app a plain **node server**?\"_\n- etc.\n\nThis package is extending the functionality of [react-device-detect](https://www.npmjs.com/package/react-device-detect), by additionally detecting which 'platform' your code is running on and other things.\n\n## Live demos\n\n### Using who-am-i-now in an expo app\n\nhttps://snack.expo.dev/@maks-io/who-am-i-now-demo\n\n### Using who-am-i-now in a react app\n\nhttps://stackblitz.com/edit/who-am-i-now-react\n\n### Using who-am-i-now in a next.js app\n\nhttps://stackblitz.com/edit/who-am-i-now-nextjs\n\n## Installation\n\nVia npm:\n\n```bash\nnpm i who-am-i-now --save\n```\n\nVia yarn:\n\n```bash\nyarn add who-am-i-now\n```\n\n## Usage\n\n```typescript\nimport WhoAmINow, { Who } from \"who-am-i-now\";\n\nconst who: Who = WhoAmINow();\n\n// Example result:\n// who = {\n//     isMobile: true,\n//     isBrowser: false,\n//     isReactNativeApp: true,\n//     isReactNativeAppIOS: true,\n//     isReactNativeAppAndroid: false,\n//     isReactNativeAppWeb: false,\n//     isExpoApp: true,\n//     isReactApp: false,\n//     isNextApp: false,\n//     isTWA: false,\n//     isPWAStandalone: false,\n//     isServerApp: false,\n//     ... and many others - check section below for details\n// }\n```\n\n## Selectors\n\nThe result of calling `whoAmINow()` is an object holding various selectors/booleans/values.\nEvery prop is either\n\n- inheriting the behaviour from the original `react-device-detect` library (entries marked with \\*\\*), or\n- having a different behaviour compared to the original `react-device-detect` library (entries marked with \\*), or\n- completely new (entries in table without asterisks)\n\n| selector                | type                 | explanation                                                                                                                                                                                         |\n| ----------------------- | -------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| isReactNativeApp        | boolean              | returns `true` if code is running in a `react-native` app (with and without `expo`)                                                                                                                 |\n| isReactNativeAppIOS     | boolean              | returns `true` if code is running in a `react-native` app (with and without `expo`) and if the platform is `ios`                                                                                    |\n| isReactNativeAppAndroid | boolean              | returns `true` if code is running in a `react-native` app (with and without `expo`) and if the platform is `android`                                                                                |\n| isReactNativeAppWeb     | boolean              | returns `true` if code is running in a `react-native` app (with and without `expo`) and if the platform is `web` (Note that this will be `false` if code is running in a plain react web app!)      |\n| isExpoApp               | boolean              | returns `true` if code is running in a `react-native` app via `expo`                                                                                                                                |\n| isExpoAppRunningInGo    | boolean \\| undefined | returns `true` if code is running in `expo` Go, returns `false` otherwise, if it is still an expo app, and returns `undefined` in every other case                                                  |\n| isExpoSnack             | boolean \\| undefined | returns `true` if code is running in an `expo` snack, returns `false` otherwise, if it is still an expo app, and returns `undefined` in every other case                                            |\n| isReactApp              | boolean              | returns `true` if code is running in a `react` app                                                                                                                                                  |\n| isNextApp               | boolean              | returns `true` if code is running in a `nextjs` app                                                                                                                                                 |\n| isTWA                   | boolean              | returns `true` if code is running as part of an android `trusted web activities` app                                                                                                                |\n| isPWAStandalone         | boolean              | returns `true` if code is running as part of a `progressive web app / PWA` in `standalone` mode, meaning in an `installed` way (for instance, after user decided to _\"add app to homescreen\"_ etc.) |\n| isServerApp             | boolean              | returns `true` if code is running in a plain `node` \"server\" app (imagine a classical `express` api/server for instance)                                                                            |\n| isCI                    | boolean              | returns `true` if code is running as part of a `continuous integration / CI` pipeline (since version `2.1.0` it relies on the `is-ci` package)                                                      |\n| isTestRun               | boolean              | returns `true` if code is running as part of a test run (for instance jest unit tests, etc. - it relies on the environment to set the variable `NODE_ENV=test`)                                     |\n| isJestTestRun           | boolean              | returns `true` if code is running as part of a `jest` test run                                                                                                                                      |\n| isCypressTestRun        | boolean              | returns `true` if code is running as part of a `cypress` test run                                                                                                                                   |\n| isBrowser\\*             | boolean              | returns `true` if code is running in a browser - the behaviour from `react-device-detect` was slightly changed                                                                                      |\n| isMobile\\*              | boolean              | returns `true` if code is running in a `react-native` app (with and without `expo`) but not in `web` browser (via `react-native-web`)                                                               |\n| isDesktop\\*             | boolean              | returns `true` if code is NOT running in a `react-native` app (with and without `expo`) - in other words, this is the opposite of `isMobile` above                                                  |\n| isMobileOnly\\*\\*        | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isTablet\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isSmartTV\\*\\*           | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isWearable\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isConsole\\*\\*           | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isEmbedded\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isAndroid\\*\\*           | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isWinPhone\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIOS\\*\\*               | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isChrome\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isFirefox\\*\\*           | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isSafari\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isOpera\\*\\*             | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIE\\*\\*                | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isEdge\\*\\*              | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isYandex\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isChromium\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isMobileSafari\\*\\*      | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isSamsungBrowser\\*\\*    | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| osVersion\\*\\*           | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| osName\\*\\*              | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| fullBrowserVersion\\*\\*  | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| browserVersion\\*\\*      | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| browserName\\*\\*         | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| mobileVendor\\*\\*        | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| mobileModel\\*\\*         | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| engineName\\*\\*          | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| engineVersion\\*\\*       | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| getUA\\*\\*               | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| deviceType\\*\\*          | string               | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIOS13\\*\\*             | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIPhone13\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIPad13\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isIPod13\\*\\*            | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isElectron\\*\\*          | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isEdgeChromium\\*\\*      | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isLegacyEdge\\*\\*        | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isWindows\\*\\*           | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n| isMacOs\\*\\*             | boolean              | returns the same value `react-device-detect` returns                                                                                                                                                |\n\n## Misc\n\nYoutube short: https://youtube.com/shorts/sKyRYo9h514?feature=share\n\n## Release workflow\n\nReleases are automated via `semantic-release` and are triggered by pushes to `main`.\n\n- Feature branches are safe to push and only run CI.\n- Commits that land on `main` must follow the conventional commit format.\n- `semantic-release` decides whether to publish a new version based on the commits since the last git tag.\n\n### Source of truth for versions\n\nThe canonical released version is the latest npm version / git tag / GitHub Release.\n\nThe checked-in `package.json` version in this repository may lag behind the latest published npm version. This is expected in the current setup because release metadata is generated during CI and is not committed back to `main`.\n\nIf you want to inspect the latest released version locally, fetch tags and inspect the most recent one:\n\n```bash\ngit fetch --tags\ngit tag --sort=-version:refname | head -n 5\n```\n\n### Local commands\n\n```bash\nnpm run commit\nnpm run verify\nnpm run release:dry-run\n```\n\n- `npm run commit` opens the interactive conventional commit flow.\n- `npm run verify` runs the build and test suite.\n- `npm run release:dry-run` previews what `semantic-release` would do without publishing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks-io%2Fwho-am-i-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaks-io%2Fwho-am-i-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks-io%2Fwho-am-i-now/lists"}