Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions appkit/javascript/payments/pay-with-self-custodial-wallets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: AppKit Pay with Self-Custodial Wallets - JavaScript
sidebarTitle: Pay with Self-Custodial Wallets
---

**AppKit Pay with Self-Custodial Wallets** enables end users to make crypto payments directly from non-custodial wallets. This includes mobile wallets connected via WalletConnect as well as many browser wallets, giving users full control of their assets throughout the payment process.

## Quick Start
Here you can find a simplify process to integrate AppKit Pay with Javascript SDK:

<Warning>
Projects first need to install and set up Reown AppKit before integrating AppKit Pay. If you haven't done so, please refer to the [Reown AppKit docs](/appkit/overview#quickstart).
</Warning>

### Install the library

<Note>
Projects currently using Reown AppKit to enable self-custodial wallet payments in their own checkout flows are encouraged to switch to AppKit Pay for a simpler integration and significantly improved user experience. AppKit Pay can be found in `@reown/appkit-pay` npm package.
</Note>

<CodeGroup>

```bash npm
npm install @reown/appkit-pay
```

```bash Yarn
yarn add @reown/appkit-pay
```

```bash Bun
bun a @reown/appkit-pay
```

```bash pnpm
pnpm add @reown/appkit-pay
```
</CodeGroup>

### `pay` - Full Payment Flow

#### Usage
```ts
import { pay, baseSepoliaETH } from '@reown/appkit-pay'
```

This function handles the complete payment flow — it opens the payment UI *and* waits for the result (success, failure, cancel, timeout). This function receives three values: `recipient`, `amount`, and `paymentAsset`.

```ts
// pay function returns a PaymentResult object
const result = await pay({
recipient: addressRecipient,
amount: amount,
paymentAsset: baseSepoliaETH
});

if (result.success) {
console.log("Payment successful: " + result.result);
} else {
console.error("Payment error: " + result.error);
}
```

## Prerequisites

### Enable Payments Feature in Dashboard

The "Payments" feature **must be enabled** in the [Reown Dashboard](https://dashboard.reown.com) before you can use AppKit Pay, even for local testing.

1. Go to your project in the Reown Dashboard
2. Navigate to the Payments section
3. Enable the Payments feature for your projectId


## Test locally

In order to test locally use localhost and port 3000. This is the only port available for local testing.

Add the following to your package.json file in order to run the development server on port 3000:
```json
"scripts": {
"dev": "vite --port 3000",
},
```

## Supported Networks and Assets

For a complete list of supported networks and assets across different exchanges (Coinbase, Binance), please refer to the [Networks and Assets Supported](/appkit/payments/pay-with-exchange#networks-and-assets-supported) section in our Pay with Exchange documentation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto Review Issue: Exchange-specific content on JavaScript self-custodial wallets page

Severity: HIGH
Category: code_quality
Tool: Claude Auto Review

Context:

  • Pattern: Line 88 links to exchange-specific networks/assets ("across different exchanges (Coinbase, Binance)") and lists getExchanges function (line 123-126) — both are exchange-only concepts
  • Risk: Developers building self-custodial wallet integrations will be misled into thinking they need exchange configuration or that getExchanges is relevant to their use case
  • Impact: Inaccurate documentation; the JS self-custodial page is functionally identical to the exchange page (only the intro text differs)
  • Trigger: Any developer reading the JavaScript integration guide for self-custodial wallets

Recommendation: - Line 88: Replace with a general "Supported Networks and Assets" statement not tied to exchange networks

  • Lines 123-126: Remove getExchanges from the functions list on the self-custodial page; it is exchange-only


## Assets Configuration

For the moment, AppKit Pay has pre-configured these assets:
- baseETH, baseSepoliaETH, and baseUSDC
- ethereumUSDC, optimismUSDC, arbitrumUSDC, polygonUSDC and solanaUSDC
- ethereumUSDT, optimismUSDT, arbitrumUSDT, polygonUSDT and solanaUSDT

```ts
import { baseETH } from '@reown/appkit-pay'
```

For custom assets, you can create a paymentAsset object with all the information:

```ts
// Configure the paymentAsset
const paymentAssetDetails = {
network: 'eip155:8453', // Base Mainnet
asset: 'native', // Or USDC in Base: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
metadata: {
name: 'Ethereum', // Or 'USD Coin'
symbol: 'ETH', // Or 'USDC'
decimals: 18 // Or 6 for USDC
}
};
```

## Functions

### pay
Opens the payment modal. Resolves when the modal is closed by the user or programmatically.

`pay(amount, addressRecipient, options: PaymentOptions): Promise<PaymentResult>`

### getExchanges
Fetches available exchanges.

`getExchanges(page?: number): Promise<{ exchanges: Exchange[], total: number }>`

### getPayResult
Use with caution regarding timing; subscriptions are preferred.

`getPayResult(): PayResult | null`

Returns the result of the last successful payment.

### getPayError
Use with caution regarding timing; subscriptions are preferred.

`getPayError(): AppKitPayErrorMessage | null`

Returns the error object if the last payment failed.

### getIsPaymentInProgress
Checks if a payment is currently processing.

`getIsPaymentInProgress(): boolean`
8 changes: 8 additions & 0 deletions appkit/next/payments/pay-with-self-custodial-wallets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: AppKit Pay with Self-Custodial Wallets - Next.js
sidebarTitle: Pay with Self-Custodial Wallets
---

import AppKitPay from "/snippets/appkit/shared/appkit-pay-react.mdx";

<AppKitPay />
12 changes: 8 additions & 4 deletions appkit/payments/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ These solutions provided by Reown give providers access to hundreds of millions

Reown powers modern payment experiences like:

1. **Pay with Self Custodial Wallet**: Let users pay with their self custodial wallets like MetaMask, Trust, Ledger, and more. This flow is bundled together with the **Pay with Exchange** flow.
1. **Pay with Exchange**: Let users pay directly from Centralized Exchanges (CEXs) like Binance, Coinbase, and more.

2. **Pay with Exchange**: Let users pay directly from Centralized Exchanges (CEXs) like Binance, Coinbase, and more.
2. **Pay with Self-Custodial Wallets**: Let users pay with their self-custodial wallets like MetaMask, Trust, Ledger, and more.

3. **1-Click Checkout**: Fast, mobile-optimized, self-custodial and crypto native checkout flows (coming soon).

Expand All @@ -56,8 +56,12 @@ With **multi-platform SDKs**, **battle-tested infrastructure**, and **exclusive
## Get Started

<CardGroup cols={3}>
<Card title="Pay with Exchange and Self Custodial Wallets" icon="money-check-dollar" href="/appkit/payments/pay-with-exchange">
Get started with AppKit Pay with Exchange and self-custodial wallets.
<Card title="Pay with Exchange" icon="money-check-dollar" href="/appkit/payments/pay-with-exchange">
Get started with AppKit Pay with Exchange.
</Card>

<Card title="Pay with Self-Custodial Wallets" icon="wallet" href="/appkit/payments/pay-with-self-custodial-wallets">
Get started with AppKit Pay with Self-Custodial Wallets.
</Card>

<Card
Expand Down
106 changes: 9 additions & 97 deletions appkit/payments/pay-with-exchange.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Pay with Exchange & Self-Custodial Wallets
title: Pay with Exchange
---

**AppKit Pay with Exchange** unlocks a powerful new flow: users can pay in crypto directly from their **Centralized Exchange (CEX) accounts** like Binance or Coinbase, **with no new wallets, no app switching, and no lost conversions.** This flow is bundled together with the **Pay with Self-Custodial Wallets** flow.
**AppKit Pay with Exchange** unlocks a powerful new flow: users can pay in crypto directly from their **Centralized Exchange (CEX) accounts** like Binance or Coinbase, **with no new wallets, no app switching, and no lost conversions.**

<Warning>
Coinbase is currently not available in the AppKit Pay with Exchange flow. Further information will be available soon.
Expand Down Expand Up @@ -41,7 +41,7 @@ Want to see AppKit Pay with Exchange in action? Try out the live demo to experie

## Networks and Assets Supported

Currently, AppKit Pay with Exchange and Self-Custodial Wallets supports the following assets on the following networks:
Currently, AppKit Pay with Exchange supports the following assets on the following networks:

**Asset -> Network**

Expand Down Expand Up @@ -70,27 +70,27 @@ This feature is currently in early access. If you are **interested in getting ea

<CardGroup cols={2}>
<Card title="React" icon="react" href="/appkit/react/payments/pay-with-exchange">
Get started with AppKit Pay with Exchange and self-custodial wallets in React.
Get started with AppKit Pay with Exchange in React.
</Card>

<Card
title="Next.js"
icon="square-n"
href="/appkit/next/payments/pay-with-exchange"
>
Get started with AppKit Pay with Exchange and self-custodial wallets in Next.js.
Get started with AppKit Pay with Exchange in Next.js.
</Card>

<Card
title="Vue"
icon="vuejs"
href="/appkit/vue/payments/pay-with-exchange"
>
Get started with AppKit Pay with Exchange and self-custodial wallets in Vue.
Get started with AppKit Pay with Exchange in Vue.
</Card>

<Card title="JavaScript" icon="js" href="/appkit/javascript/payments/pay-with-exchange">
Get started with AppKit Pay with Exchange and self-custodial wallets in JavaScript.
Get started with AppKit Pay with Exchange in JavaScript.
</Card>
</CardGroup>

Expand Down Expand Up @@ -138,7 +138,7 @@ This feature is currently in early access. If you are **interested in getting ea
</Accordion>

<Accordion title="What happens if the user is not logged onto their exchange?">
If the user doesnt have an active browser session with the exchange, they will be prompted to log in by the exchange.
If the user doesn't have an active browser session with the exchange, they will be prompted to log in by the exchange.
</Accordion>

<Accordion title="How do you handle failed or delayed withdrawals?">
Expand Down Expand Up @@ -224,6 +224,7 @@ This feature is currently in early access. If you are **interested in getting ea
If the user opts to buy crypto currency on the exchange instead of using available crypto balance, they may be subject to exchange trading fees. These will be shown to the user, broken down by exchange fees and network (withdrawal) fees.
</Accordion>
</AccordionGroup>

### Strategic Benefits

<AccordionGroup>
Expand All @@ -243,92 +244,3 @@ This feature is currently in early access. If you are **interested in getting ea
- Fully compatible with existing PSP/Dapp/Wallet infrastructures
</Accordion>
</AccordionGroup>

## Pay with Self-Custodial Wallets FAQs

<AccordionGroup>
<Accordion title="What is 'Pay with Self-Custodial Wallets'?">
**Pay with Self-Custodial Wallets** is a feature of Reown's AppKit for Payments, enabling end users to make crypto payments directly from **non-custodial wallets.** This includes mobile wallets connected via WalletConnect as well as many browser wallets, giving users full control of their assets throughout the payment process.
</Accordion>

<Accordion title="How is it different from Pay with Exchange?">
Pay with Wallet uses **self-custodial wallets**, while Pay with Exchange initiates payments from **CEX accounts.** They can be used at the same time as both features are available through the same SDK and UI, letting the user choose the best options for them while making the integration fast and simple.
</Accordion>

<Accordion title="Which wallets are supported?">
600+ wallets are supported - all major wallets and any wallet that supports WalletConnect.
</Accordion>
</AccordionGroup>

### User Experience

<AccordionGroup>
<Accordion title="How does the user authorize a payment?">
The user first connects their chosen wallet after which they will see a transaction prompt in their wallet interface with recipient address, network, asset and amount pre-filled. To complete the payment, the user must confirm the transaction in their chosen wallet.
</Accordion>

<Accordion title="What happens if a user cancels mid-flow?">
If a user abandons the flow before signing the transaction in their wallet, **no transaction occurs**. Apps can implement timeout logic to handle cancellations gracefully.
</Accordion>

<Accordion title="Can a user switch wallets?">
Yes, a user can simply disconnect a wallet and connected another without losing the payment detail.
</Accordion>
</AccordionGroup>
### Compliance, Security & Observability

<AccordionGroup>
<Accordion title="Can we monitor transactions in real time?">
Yes. AppKit provides **blockchain** **transaction IDs**, which can be used for real-time monitoring and reconciliation.
</Accordion>
</AccordionGroup>
### Integration & Support

<AccordionGroup>
<Accordion title="How do we integrate this into our checkout or app flow?">
Pay with Wallet is part of **AppKit Pay**, which includes components to handle wallet connection, transaction creation, and monitoring. Integration follows the standard AppKit SDK setup and works as a modal.
</Accordion>

<Accordion title="How long does a full integration typically take?">
For developers already using AppKit, integration is estimated to take **less than a day**. New customers must first complete the AppKit SDK integration, which typically takes a few days depending on team setup.
</Accordion>

<Accordion title="What's your uptime guarantee?">
Reown guarantees 99.9% uptime for paid customers, 90-day uptime can be found [here](https://status.reown.com/).

Availability of a particular wallet will also depend on the wallet uptime.
</Accordion>
</AccordionGroup>

### Pricing & Fees

<AccordionGroup>
<Accordion title="What does it cost to use Pay with Wallet?">
Reown uses a **tiered pricing model**, calculated on the USD value of processed payments. These fees are billed to Reown's customers monthly, and not applied to end users at the time of payment.
</Accordion>

<Accordion title="Are there overage fees or API rate limits?">
Yes, if usage exceeds AppKit tier limits.
</Accordion>

<Accordion title="Who pays the network fees?">
The **end user covers network fees**, they will be visible upon signing the transaction in the wallet.
</Accordion>
</AccordionGroup>

### Strategic Benefits

<AccordionGroup>
<Accordion title="Why should we offer 'Pay with Wallet' to our users?">
- Reach **600+ wallets** and millions of users with one integration
- Seamless UX for Ethereum, and other major networks
- Pre-filled amount, network, asset removes **manual steps for users and** eliminates over/underpayment risk
</Accordion>

<Accordion title="Are there distinctive elements with your solution?">
- **Cross-wallet support** without needing individual wallet SDKs
- Real-time observability
- Option to mix with **Pay with Exchange** in the same checkout flow and one integration
</Accordion>
</AccordionGroup>

Loading