Returns the button with given id
If id is not provided, returns the first button instance
If no button instance found returns undefined
Optional
id: stringCreates the button with given configuration
id
attribute is required for creating more than one Identity Button.
Registers signin
event handler.
This event handler needs to be registered also on the redirect callback page to trigger handling redirect response.
Registers error
event handler.
Sets the payment context.
This is required to be able to run the SIWK + Tokenization flow.
Main interface to the Identity API
SDK Initialization
Example 1: Generate button with SDK
This is the recommended and preferred method of integration
1.1. Render the Identity Button
1.2. Capture events
1.3. Cleanup
Example 2: Attach Identity Button behavior to a custom button
2.1 Add the custom button to the document
2.2 Attach Identity Button behavior
2.3. Capture events
2.4. Cleanup
Example 3: Add multiple Identity Buttons
If needed you can create multiple Identity Buttons
Example 4: Resizing the button (if needed)
The Identity Button is responsive and you can adjust its size by specifying the width and height of the
klarna-identity-button-custom-size
class.Example 5: Setup Tokenization flow
5.1. Request the payment:customer_present scope
5.2. Set the payment context
This is required to be able to run the SIWK + Tokenization flow. We will use the information provided here to create a payment request.
5.3. Handle signin event