Skip to content

Commit 6bf5d0f

Browse files
committed
added /fetch debug page to the docs
1 parent ffefa38 commit 6bf5d0f

File tree

3 files changed

+55
-11
lines changed

3 files changed

+55
-11
lines changed

docs/getting-started/create-your-first-url.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ This will show you the exact JSON response containing all the payment details th
6666
- The payment destination (a Base address)
6767
- Other technical details for the X402 protocol
6868

69+
## Test Your URL Instantly
70+
71+
For immediate testing without any setup, visit [proxy402.com/fetch](https://proxy402.com/fetch). This web interface lets you:
72+
- Test X402 requests with any URL
73+
- Connect your wallet via WalletConnect (MetaMask, etc.)
74+
- See formatted X402 responses and payment details
75+
- Make payments directly in the browser
76+
77+
![Debug Tool Interface](/img/debug-page.png)
78+
79+
Simply paste your monetized URL, click "Test Request" to see the X402 response, then use "Connect Wallet" and "Pay" to complete the payment flow.
80+
6981
Now that you have a test URL, let's see how you can pay for it in the next section.
7082

7183
## What's Next?

docs/getting-started/paying-for-content.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,42 @@ sidebar_label: "Pay for Content"
55

66
# Paying for Monetized Content
77

8-
In this section, we'll walk through paying for monetized content (URLs or files), understanding how to handle test versus production payments, and how to use access credits. We'll use the Proxy402 client from the GitHub repository.
8+
In this section, we'll walk through paying for monetized content (URLs or files), understanding how to handle test versus production payments, and how to use access credits. We'll cover both the web-based debug tool and the CLI client.
99

10-
## Setting Up the Client
10+
## Method 1: Web Interface (Recommended)
11+
12+
The fastest way to test and pay for X402 content is using the web interface at [proxy402.com/fetch](https://proxy402.com/fetch).
13+
14+
![Debug Tool Interface](/img/debug-page.png)
15+
16+
### Testing X402 Responses
17+
18+
1. Visit [proxy402.com/fetch](https://proxy402.com/fetch)
19+
2. Paste your monetized URL (e.g., `https://proxy402.com/OsD8kKUZo3`)
20+
3. Click "Test Request" to see the X402 response with payment details
21+
4. Copy the X-Payment header if you want to use it manually
22+
23+
### Making Payments
24+
25+
1. Click "Connect Wallet" to connect via WalletConnect (MetaMask, etc.)
26+
2. For test payments, get test funds from the [Circle USDC Faucet](https://faucet.circle.com/) (select "BASE USDC" for Base Sepolia)
27+
![Faucet Selection](/img/faucet.png)
28+
3. Click "Pay" to complete the payment using your connected wallet
29+
4. After payment, you'll see the response with headers including the `X-Payment` header for future access
30+
31+
### Using Purchased Credits
32+
33+
If your resource grants multiple access credits, use the `X-Payment` header from your successful payment:
34+
35+
1. Paste the `X-Payment` header value in the "Paste your X-Payment header here" field
36+
2. Click "Test Request" to access the content using your credits
37+
3. Each use consumes one credit without requiring a new blockchain transaction
38+
39+
## Method 2: CLI Client
40+
41+
For developers who prefer command-line tools or need to integrate payments programmatically:
42+
43+
### Setting Up the Client
1144

1245
Let's start by cloning the Proxy402 repository and navigating to the client folder:
1346

@@ -31,7 +64,7 @@ And install dependencies:
3164
npm install
3265
```
3366

34-
## Creating a Wallet
67+
### Creating a Wallet
3568

3669
You'll need a private key for a Base address to make payments. You can use an existing wallet or create a new one. If you don't have one, you can create it using Foundry:
3770

@@ -69,7 +102,7 @@ You'll need a private key for a Base address to make payments. You can use an ex
69102
>
70103
> For more details on installing Foundry, see the [official documentation](https://book.getfoundry.sh/getting-started/installation).
71104
72-
## Making Your First Payment Attempt
105+
### Making Your First Payment Attempt
73106

74107
With the client set up and your private key in the `.env` file, try accessing a monetized URL (e.g., one you created in the previous guide, or the demo `https://proxy402.com/OsD8kKUZo3`):
75108

@@ -79,7 +112,7 @@ npm run client -- https://proxy402.com/OsD8kKUZo3
79112

80113
If your wallet is new and unfunded, you'll likely see an error message from the client indicating **"Insufficient funds"**. This is expected.
81114

82-
## Adding Test Funds
115+
### Adding Test Funds
83116

84117
To proceed with test payments (for resources in "test mode" on Proxy402), your wallet needs test USDC for the Base Sepolia network.
85118

@@ -88,7 +121,7 @@ To proceed with test payments (for resources in "test mode" on Proxy402), your w
88121
![Faucet Selection](/img/faucet.png)
89122
3. Enter your wallet address (the one that starts with `0x` from the `cast wallet new` step) and request funds.
90123

91-
## Successful Payment and Accessing Content
124+
### Successful Payment and Accessing Content
92125

93126
Once your wallet has test funds, run the command again:
94127

@@ -108,7 +141,7 @@ This time, the payment should succeed! Here's what to expect:
108141
```
109142
To download the file, copy the entire `download_url` and paste it into your web browser, or use a command-line tool like `curl "PASTED_DOWNLOAD_URL" -o bitcoin-paper.pdf`.
110143

111-
## Using Purchased Credits
144+
### Using Purchased Credits
112145

113146
When you successfully pay for a resource, the Proxy402 server always includes an `X-Payment` header in its HTTP response. If the resource you paid for grants multiple access credits, this `X-Payment` header value is the token you'll use to access your remaining credits.
114147

@@ -142,7 +175,7 @@ If your token is invalid (e.g., all credits used or expired), the `proxy402/clie
142175

143176
For more client command details, see the `proxy402/client/README.md`.
144177

145-
## Making Production Payments (Mainnet)
178+
### Making Production Payments (Mainnet)
146179

147180
When you want to pay for resources that are *not* in "test mode" (i.e., they require real payment on the Base mainnet):
148181

@@ -154,13 +187,12 @@ When you want to pay for resources that are *not* in "test mode" (i.e., they req
154187
```
155188
The client requires you to specify the network; it does not automatically detect it from the server's L402 challenge.
156189
157-
## Checking Your Monetized Resources
190+
### Checking Your Monetized Resources
158191
159192
If you created your own monetized URL or file, you can use the client to pay for it too:
160193
161194
```bash
162195
npm run client -- https://proxy402.com/OsD8kKUZo3
163196
```
164197
165-
After making a payment (or using a credit), go back to your Proxy402 dashboard and check your resource's statistics. You'll see that the "Attempts," "Payments," and potentially "Accesses" (if credits were used) counters have increased, and your earnings reflect any new payments.
166-
198+
After making a payment (or using a credit), go back to your Proxy402 dashboard and check your resource's statistics. You'll see that the "Attempts," "Payments," and potentially "Accesses" (if credits were used) counters have increased, and your earnings reflect any new payments.

static/img/debug-page.png

754 KB
Loading

0 commit comments

Comments
 (0)