Simple HTML/JS integration
Simple HTML/JavaScript Integration
1. Include the Script
<script src="https://app.staysignal.com/api/widget/script/YOUR_SITE_ID_HERE"></script>2. Initialize the Widget
<script>
StaySignal.init({
// site_id is embedded in the script loaded via /api/widget/script/[siteId]
onComplete: (payload) => {
console.log('Widget flow complete:', payload);
if (payload.resolution === 'cancelled') {
// Handle successful cancellation
} else {
// Handle when user decides to stay
}
},
onError: (error) => {
console.error('Widget error:', error);
}
});
</script>3. Add Cancel Buttons
Complete Example
Testing
Need Help?
Last updated