1. Home
  2. Docs
  3. Javascript API
  4. isSubscribed()

isSubscribed()

Prompty.isSubscribed() is an asynchronous function. It returns true if the user’s browser indicates there is an active subscription or false otherwise. The example code below demonstrates how to conditionally display a form to unsubscribed users.

<script>
async function checkSubStatus() {
	let status = await Prompty.isSubscribed();
	if (status == false) { $(".wpn-form").show(); }
}
checkSubStatus();
</script>
Was this article helpful to you? Yes No

How can we help?