Version 1 · Rocket supplies the button; your application supplies its existing authorization or purchase handler.
Primary: Rocket blue #167ac6, white mark and text without
an outline. Dark: #172331, white mark and text. Light:
white with #172331 mark and text, visible border. White
text on the primary blue meets WCAG AA text contrast.
<script defer src="https://tryrocket.ai/buttons/v1/rocket-buttons.js"></script> <rocket-button id="rocket-sign-in" action="continue" variant="primary"></rocket-button> <rocket-button id="rocket-buy" action="buy" variant="primary"></rocket-button>
document.getElementById("rocket-sign-in")
.addEventListener("rocket-activate", startExistingRocketSignIn);
document.getElementById("rocket-buy")
.addEventListener("rocket-activate", startExistingRocketPurchase);
// While your existing handler is pending:
button.setAttribute("loading", "");
// On failure or completion:
button.removeAttribute("loading");
The kit is a framework-independent custom element, works with React, Vue
and ordinary HTML, and makes no network requests for identity or
payment. Its mark is embedded. It uses a native button inside Shadow DOM
so host styles do not alter branding. Add
https://tryrocket.ai to your script policy and allow the
component's inline styles and data-image mask if your CSP restricts
them. Do not weaken an existing CSP: review your policy or self-host the
unmodified versioned file. Nothing else is loaded. Importing is safe
only in the browser; load after client hydration for SSR apps.
Supported attributes: action="continue|buy",
variant="primary|dark|light", boolean
loading and disabled (remove them to reset;
setting "false" still enables a boolean attribute). Listen for
rocket-activate, not both that and click. Action and
variant fall back to Continue with Rocket and primary when invalid. Set
a Buy control disabled until your existing eligibility checks pass. Keep
price, currency, recurrence and purchase terms beside the button.