WebLN Guide
Ask or search…
K
🆕

webln.isEnabled()

webln.isEnabled() allows you to check if webln is enabled without explicitly enabling it through webln.enable() (which may cause a confirmation popup in some providers)
This API may not be available on all providers.

Method

function isEnabled(): Promise<boolean>;
Example
if(typeof window.webln !== 'undefined' && window.webln.isEnabled) {
const isEnabled = await window.webln.isEnabled();
// do something with the value
console.log(isEnabled)
}

Demo

Last modified 4mo ago