Detect in-app browsers - fork of detect-inapp
with API modifications + additions
yarn add inapp-spy
npm install inapp-spy
import InAppSpy from "inapp-spy";
const { isInApp, appKey, appName } = InAppSpy();
{
// 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
// Experimental and unstable detection of SFSafariViewController (SFSVC)
// - Downloading UX in SFSVC is almost useless compared to regular Safari
// - If SFSVC is detected, `isInApp` will be `false` and `appKey` will be `undefined`
// - Subject to change, use with caution
isSFSafariViewController: boolean;
}
InAppSpy({
ua?: string; // not required
})
MIT License
- Bowser - Browser + OS detection
- InAppDebugger - Easily debug in-app browsers. Uses both
bowser
andinapp-spy
libraries.
inapp-spy
is a fork of detect-inapp
with modifications. This wouldn't exist without the original work of the detect-inapp
contributors.