Risk SDK
Interlace RiskCore Browser SDK Integration Guide
Load risk-core-v3.js on your checkout page to create a risk session and obtain a riskSessionId for each payment attempt.
1. Load the SDK
Include the hosted script on your checkout page and initialize it when the payment page is ready.
<script src="https://res.interlace.money/risk-core-v3.js"></script>
2. Create a risk session
Initialize the SDK with the Interlace account identifier provided for your merchant and the environment used for the payment. The init method returns a Promise that resolves to a riskSessionId.
async function createRiskSession() {
return await window.RiskCore.init({
clientAccount: "your_client_account_id",
environment: "sandbox" // sandbox or prod
});
}
Supported environments are sandbox and prod. Use the environment that matches the payment.
3. Get the riskSessionId
Call createRiskSession and wait for it to resolve before continuing with the payment flow.
const riskSessionId = await createRiskSession();
4. Usage notes
- Create a risk session for each payment attempt and use it only for that attempt. Do not reuse an ID for another order.
- A risk session ID is valid for approximately 30 minutes. If the customer stays on the checkout page for an extended period, call
createRiskSessionagain to obtain a fresh ID. - Initialize the SDK before the customer submits the payment.
- Ensure your checkout page's Content Security Policy and network policies allow access to the SDK domain above.
Updated about 15 hours ago
Did this page help you?