JavaScript SDK
Integrate Transak into your application using the Transak JavaScript SDK
The Transak JavaScript SDK integration allows you to integrate Transak into your application, making it easy to launch and manage the Transak interface within your web project.
Integrate Using the SDK
Initialize the SDK with widgetUrl and add event listeners in your app.
Example:
React: Cleanup - If you are using React 18+, do not forget to run the cleanup code.
Create Widget URL (using Backend Only)
Call the Create Widget URL to generate a Widget URL by securely passing the widget parameters.
The response returns a widgetUrl that should be passed as widgetUrl in Step 2.
A widgetUrl is valid for 5 minutes and can only be used once. A new widgetUrl must be generated for every user flow.
Example Request:
Events
The Transak SDK emits the following events, which you can use to track state and user actions.