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 } = InAppSpy();

API Reference

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

Parameters (optional)

{
  ua?: string;
}

Return properties

isInApp

boolean - Whether the user is in an in-app browser

appName

Values: "messenger", "facebook", "twitter", "wechat", "instagram", "tiktok", "snapchat", "line", or undefined

Can be undefined even when isInApp is true.

ua

string - The 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.