inapp-spy
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

InAppSpy 🔎

Detect in-app browsers - fork of detect-inapp with API modifications + additions

Installation

yarn add inapp-spy
npm install inapp-spy

Code Example

import InAppSpy from "inapp-spy";

const { isInApp, appKey, appName } = InAppSpy();

API Reference

Return properties

{
  // Detected in-app browser
  isInApp: boolean;

  // Recognized app with in-app browser
  appKey: "messenger" |
    "facebook" |
    "twitter" |
    "wechat" |
    "instagram" |
    "tiktok" |
    "snapchat" |
    "line" |
    undefined; // can be undefined if `isInApp: true`

  // Pretty printed app name
  // - ie `appKey: 'tiktok', appName: 'TikTok'`
  // - Subject to change, use `appKey` for programmatic use
  appName: string;

  ua: string; // The user agent passed in or figured out by `InAppSpy()` function
}

Parameters (optional)

InAppSpy({
  ua?: string; // not required
})

License

MIT License

Related

  • Bowser - Browser + OS detection
  • InAppDebugger - Easily debug in-app browsers. Uses both bowser and inapp-spy libraries.

Thanks

inapp-spy is a fork of detect-inapp with modifications. This wouldn't exist without the original work of the detect-inapp contributors.

Readme

Keywords

Package Sidebar

Install

npm i inapp-spy

Weekly Downloads

240

Version

3.0.0

License

MIT

Unpacked Size

17.5 kB

Total Files

9

Last publish

Collaborators

  • shalanah