Klarna is introducing a new WebSDK that aims to streamline the integration process and offer a more robust, fast and safe solution for partners. Although designed to be backward compatible, some changes might be necessary depending on your setup. Below are the steps to ensure a smooth transition.
Link copied!
Replace your existing <script> tag as follows:
Link copied!
Copied
<script async="" src="https://osm.klarnaservices.com/lib.js" data-client-id="<client_id>"></script>
Please do not use lib.js for new integrations.
Link copied!
Copied
<script
async
data-environment="playground | production"
src="https://js.klarna.com/web-sdk/v1/klarna.js"
data-client-id="your_klarna_live_client_">
</script>
The value of data-client-id would be different and would look like klarna_{env}_client_{longString} which you can copy from Merchant Portal
Link copied!
If you're using the ::parts API for styling, update the selectors.
Old:
Copied
#placementID *::part(osm-container) {
/* Your CSS rules here */
}
New:
Copied
#placementID::part(osm-container) {
/* Your CSS rules here */
}
Link copied!
Login to Merchant Portal and navigate to Conversion boosters to allow your domain origin.

Link copied!
If you're using CSP (Content Security Policy), you will need to whitelist js.klarna.com.
For for more details and examples please follow the steps from Integrate using Klarna Web SDK