Sardine’s web checkout widget offers a quick way to integrate our Crypto On/off-Ramp via a URL
This is best suited for quick integrations where the developer does not want to build their own UI. The Sardine Risk SDK is natively integrated into the checkout flow.
Goal
By the end of this guide, you should be able to open a new window with Sardine On/Off-ramp, either in a new tab or in a new browser window.
By default, if no parameters are passed, users will be redirected to our standard checkout widget.
client_token is the only required parameter. Additional parameters that are passed will autofill the widget for the user and allow them to skip some screens.
Supported tokens in Sandbox
Currently Sardine only supports a subset of tokens available in production on its sandbox environment. We recommend using the GET /supported-tokens endpoint to fetch the list of tokens available
Once the URL has been generated, it can be embedded into your web app as a hyperlink. Below, we have included samples of different ways of integrating the checkout
If embedding an iframe, make sure to pass camera and geolocation permission allow="camera *;geolocation *" for proper KYC collection
Recommended size is width=500, height=700 for new window
<head><script>/* The widget and begins its flow after this line, and will update the parent about its state via postMessage events.*/function attachListener() { window.addEventListener("message", (data) => console.log("Event is", data)) }</script> </head> <body> <div class="center"> <iframe src="https://crypto.sandbox.sardine.ai/?address=0x10b195F7Be9B120efd05C58f16650A13f533eA33&client_token=123-asd-456" onload="attachListener()" allow="camera *;geolocation *" id="sardine_iframe" /> //Make sure to allow camera and geolocation access </div></body>
For the off ramp to function, the User needs to send crypto to a deposit address generated by Sardine. This address is sent in a frontend event and also via webhook, and can be displayed to the User or a transaction can be created for the User to sign to send the crypto to Sardine.
The Order will be in draft status with the following JSON
Once you have completed end-to-end testing in sandbox, you can go live by swapping to a set of production keys and updating your URLs. Please see the linked guide for a step-by-step of going live in production.