npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@klarna/react-native-klarna-network-payment

v2.8.0

Published

React Native package for Klarna Network Payment

Readme

Klarna Network Payment SDK React Native

NPM React Native Platform License Developed at Klarna

React Native package for Klarna Network Payment. This library wraps KlarnaNetworkPayment and exposes payment request functionality directly on the Klarna instance via klarna.payment.

Requires @klarna/react-native-klarna-network-core to be installed and initialized first.

New Architecture only (TurboModule).

Requirements

  • iOS 13 or later.
  • Android 5.0 (API 21) or later.
  • React Native 0.76.0 or later (New Architecture required).
  • @klarna/react-native-klarna-network-core installed and initialized.

Getting started

Add Dependency

NPM

npm install @klarna/react-native-klarna-network-payment --save

Yarn

yarn add @klarna/react-native-klarna-network-payment

Usage

Import this package once at app startup (e.g. in your root index.js) to activate the payment property on Klarna. After that, klarna.payment is available anywhere you have a Klarna instance.

import '@klarna/react-native-klarna-network-payment';

Initiate with a payment request ID

Use this when a payment request already exists on the server side.

import { Klarna } from '@klarna/react-native-klarna-network-core';

const klarna = await Klarna.initialize({
  clientId: '...',
  appReturnUrl: '...',
});

const paymentRequest = await klarna.payment.initiate('payment-request-id');
console.log(paymentRequest.state); // 'IN_PROGRESS'

Initiate with payment request data

Use this to create and initiate a payment request in one step.

import type { KlarnaPaymentRequestData } from '@klarna/react-native-klarna-network-payment';

const data: KlarnaPaymentRequestData = {
  amount: 10000, // in minor currency units (e.g. cents)
  currency: 'SEK',
  paymentOptionId: 'option-id', // optional
  paymentRequestReference: 'ref-123', // optional
};

const paymentRequest = await klarna.payment.initiate(data);

Fetch a payment request

const paymentRequest = await klarna.payment.fetch('payment-request-id');

Cancel a payment request

const paymentRequest = await klarna.payment.cancel('payment-request-id');

API

klarna.payment

Accessible on any initialized Klarna instance after importing this package.

| Method | Signature | Description | | ---------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | initiate | (paymentRequestIdOrData: string \| KlarnaPaymentRequestData) => Promise<KlarnaPaymentRequest> | Initiates a payment request by ID or creates and initiates one from data. | | fetch | (paymentRequestId: string) => Promise<KlarnaPaymentRequest> | Fetches the current state of a payment request. | | cancel | (paymentRequestId: string) => Promise<KlarnaPaymentRequest> | Cancels a payment request. |

KlarnaPaymentRequest

| Field | Type | Description | | ------------------------- | ------------------------------------------ | ---------------------------------------------- | | paymentRequestId | string | Unique identifier for the payment request. | | state | KlarnaPaymentRequestState | Current state of the payment request. | | previousState | KlarnaPaymentRequestState \| null | Previous state, if any. | | stateContext | KlarnaPaymentRequestStateContext \| null | Additional context for the current state. | | stateReason | KlarnaPaymentRequestStateReason \| null | Reason for the current state, if any. | | paymentRequestReference | string \| null | Partner-supplied reference for reconciliation. |

KlarnaPaymentRequestState

'SUBMITTED' | 'IN_PROGRESS' | 'COMPLETED' | 'EXPIRED' | 'CANCELED' | 'DECLINED'

KlarnaPaymentRequestStateReason

'PARTNER_CANCELED' | 'PURCHASE_FLOW_ABORTED' | 'TECHNICAL_ERROR' | 'PAYMENT_DECLINED' | 'PAYMENT_REQUEST_SUBMITTED'

KlarnaPaymentRequestData

| Field | Type | Required | Description | | --------------------------- | ------------------------------------ | -------- | ----------------------------------------------------------- | | amount | number | Yes | Total amount in minor currency units (e.g. cents). | | currency | string | Yes | ISO 4217 currency code (e.g. "SEK"). | | paymentOptionId | string | No | Pre-select a specific payment option in the flow. | | paymentRequestReference | string | No | Partner reference for webhook correlation. | | requestCustomerToken | KlarnaRequestCustomerToken | No | Request a customer token to be returned on completion. | | shippingConfig | KlarnaShippingConfig | No | Configure shipping address collection. | | collectCustomerProfile | KlarnaCollectCustomerProfileType[] | No | Customer profile fields to collect during the flow. | | supplementaryPurchaseData | KlarnaSupplementaryPurchaseData | No | Line items, shipping, subscriptions, and on-demand details. |

Support

If you are having any issues using the SDK in your project or if you think that something is wrong with the SDK itself, please follow our support guide.

Contribution

If you want to contribute to this project please follow our contribution guide.

License

This project is licensed under Apache License, Version 2.0.