Section III · Integration

Install Stayflow.

Pick your stack, paste the snippet, point your cancel button at window.Stayflow.show(). Ten minutes, start to finish.

Flow inactive

Code snippets

<script src="https://stayflow.io/v1.js"></script>
<script>
  window.StayflowConfig = {
    apiKey: "your_api_key_here",
    customer: {
      email: "user@example.com",
      stripeSubscriptionId: "sub_xxx",
      mrr: 79
    }
  };

  document.querySelector("#cancel-btn").addEventListener("click", (e) => {
    e.preventDefault();
    Stayflow.show();
  });
</script>
01

Paste the snippet

Copy the code for your stack. Paste it next to your cancel subscription button.

02

Pass subscriber data

Fill in the customer object with email, Stripe subscription id, and current MRR.

03

Intercept the click

Call window.Stayflow.show() instead of your existing cancel handler. That’s it.