Skip to content

shalanah/inapp-spy

Repository files navigation

InApp Spy 🔎

Detect in-app browsers

Installation

yarn add inapp-spy

Code Example

import InAppSpy from "inapp-spy";

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

API Reference

InAppSpy(options: { ua?: string } | undefined)

Options (optional)

{
  ua?: string;
}

Return properties

isInApp: boolean;
appName: "line" |
  "messenger" |
  "facebook" |
  "twitter" |
  "wechat" |
  "instagram" |
  "tiktok" |
  "snapchat" |
  undefined; // undefined when it doesn't match an known app above, `isInApp` can still be true
ua: string; // user agent passed in or figured out by `InAppSpy()` function

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.