Check if the application is running as a PWA
First, install the library in your project by npm:
$ npm install check-is-pwa
Or Yarn:
$ yarn add check-is-pwa
Connect the library to the project with ES6 import:
import checkIsPwa from 'check-is-pwa';
Or CommonJS:
const checkIsPwa = require('check-is-pwa');
Next use library:
const status = checkIsPwa();
//the app is running as a PWA
checkIsPwa(); // true
// the app is NOT running as a PWA / is running in the SSR
checkIsPwa(); // false
Thanks goes to these wonderful people (emoji key):
Jakub Biesiada ๐ป |
This project follows the all-contributors specification. Contributions of any kind welcome!
This project is licensed under the MIT License ยฉ 2020-present Jakub Biesiada