Add the embed
Add one script tag from heyprio.com to each page that shows a Prio button. It wires every button marked with a data-prio attribute; a click opens Prio in a window over your page (a bottom sheet on a phone), and your customer never leaves your site.
The script tag
| Attribute | Value | Required |
|---|---|---|
| data-prio-partner | your partner ID, from your Prio contact | yes |
| data-prio-bank-link | popup (default) or frame | no |
Loading the script
Load the script from the environment you are testing: https://heyprio.com/prio-pay/v1.js for production, https://dev2.heyprio.com/prio-pay/v1.js for development. See Environments and testing.
Load it as a classic script, not a module, and once per page: only the first copy runs. data-prio-partner must be your full partner ID. Without a valid one the script wires no button and logs one console error, and PrioPay.open and PrioPay.openOnboarding fire priopay:error with embed_unavailable.
Buttons added after the page loads are wired when you call PrioPay.init().
The onboarding button
| Attribute | Value | Required |
|---|---|---|
| data-prio-onboard | — | marks the button |
| data-prio-jwt | the customer’s Prio access JWT | yes |
| data-prio-refresh-jwt | the customer’s refresh JWT | no |
| data-prio-color | dark (default) or light | no |
| data-prio-text | the button’s label | no |
With no data-prio-text the button reads Set Up Banking.
The tokens come from POST /users or GET /users/:id. Rather than leaving them in attributes any script on your page can read, fetch them from your server when your customer taps and pass them to PrioPay.openOnboarding({ jwt, refreshJwt }). The payment button is on Payment button.
Bank linking: popup or frame
With popup, the default, linking a bank opens a small Prio window at heyprio.com that runs Plaid. With frame, Plaid runs inside the Prio window on your page. Plaid does not recommend a frame: it reports bank-login (OAuth) conversion up to 15 percentage points higher outside one. A blocked popup falls back to the frame for that tap.