Function isBrowser
Returns boolean
trueif running in a browser,falseotherwiseExample
if (isBrowser()) {
// Use localStorage, fetch, etc.
window.localStorage.setItem('key', 'value')
}See
detectEnvironment for full environment detection
true if running in a browser, false otherwise
if (isBrowser()) {
// Use localStorage, fetch, etc.
window.localStorage.setItem('key', 'value')
}
detectEnvironment for full environment detection
Checks if the code is running in a browser environment