Uses this repo as a base.
inBrowserEnv is a way to check if a process is running in node or in the browser. This is useful when using frameworks like Nextjs or GatsbyJS.
npm i in-browser-env --save
yarn add in-browser-env
import inBrowserEnv from "in-browser-env"
if (isBrowserEnv()) {
// in a browser environment
}