// SECOND BUTTON RENDERED IN THE SAME PAGE constsiwkButton2 = klarna.Identity.button({ scope:"profile:name profile:email", redirectUri:"http://localhost:3000/callback", // Notice, for multiple buttons we need to provide an ID id:'secondIdentityButton', })
Main interface to the Identity API. Use
button()to create the Identity button andon()to subscribe to events.Example Group
identity-html-init mode=stack label="SDK Initialization"
Description
"Load the Klarna Web SDK module and initialize with clientId."
Example Group
identity-js mode=tabs label="JavaScript"
Description
"Create the Identity button, mount it, subscribe to render/click/signin/error events, and unmount on cleanup."
Example Tab Label
"1.1 Render the Identity Button"
Example Tab Label
"1.2 Capture events"
Example Tab Label
"1.3 Cleanup"
Example Group
identity-html-2 mode=stack label="HTML (custom button)"
Description
"Use your own button in the DOM and attach Identity behavior with attach()."
Example Group
identity-js mode=tabs label="JavaScript"
Example Tab Label
"2.2 Attach Identity Button behavior"
Example Tab Label
"2.3 Capture events"
Example Tab Label
"2.4 Cleanup"
Example Tab Label
"3. Multiple Identity Buttons"
Example Group
identity-css mode=stack label="CSS"
Description
"Optional: customize button dimensions (min width 48px, height 35–60px)."
Example Group
identity-ts-tokenization mode=tabs label="Tokenization"
Description
"Request payment:customer_present scope, start payment request, and handle signin."
Example Tab Label
"5.1 Request scope"
Example Tab Label
"5.2 Start payment request"
Example Tab Label
"5.3 Handle signin event"