Integrate Sign in with Klarna into your mobile app.
Our mobile SDK offers two ways to integrate Sign in with Klarna into your app:
This section outlines the steps you need to perform before starting the client-side integration.
You need to provide us with a valid redirect URL. This also needs to be provided when you set up the integration in the app and will be triggered when the sign in flow completes.
The redirect URL is used for two things: ensuring that the sign in flow is started from your app, and that the customer is returned to the right place.
The redirect URL must be formatted as a recognizable app schema.
App schema | Accepted | Explanation |
my-app-name | ⛔️ | Can be misread as host |
my-app-name:// | ✅ | |
my-app-name://domain.com | ✅ | |
my-app-✨ | ⛔️ | Has invalid characters. Read more about valid URLs. |
You can integrate the Sign in with Klarna button by following these steps:
The Sign in with Klarna button requires you to set some parameters before rendering in your application. The mandatory parameters you need to set are the Client ID, scope, and market values.
There are other optional parameters, for example, locale, shape, and others that you can override in the button's constructor/initializer or set after you create it.
Once you have created the button instance and set the parameters, you need to add it to your screen so it's visible to the customer in a way that they can interact with it. If you have set all the parameters correctly, the button will be rendered successfully.
Once the user completes the Sign in with Klarna flow, you will receive their profile information via the event handler you have implemented. You can then use these details to set up an account, link to an existing account, prefill the checkout, and give shoppers a personalized experience.