Generate the embed token (server-side)
Use the Gr4vy SDK to generate a signed JWT embed token:
Load Gr4vy Embed in the checkout widget
The checkout widget follows the same widget lifecycle as other widgets. After receiving the embed configuration from Load the Gr4vy Embed scriptDynamically load the Gr4vy Embed library from your instance’s CDN:Initialise Gr4vy EmbedCall Gr4vy Embed needs a Gr4vy Embed renders PCI-compliant input fields inside
start_checkout, it loads the Gr4vy Embed script and initialises the payment form. This code runs inside the widget regardless of server language.Receive the embed configurationgr4vy.setup() to render the payment form. The amount, currency, and merchantAccountId must match what was pinned in the JWT token:<form> wrapper and a container <div> with id attributes matching gr4vy.setup():#embed-container. Your app handles the surrounding UI—order summary, result screens, and the submit button. See the reference implementation for a complete example.