Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changelog/keen-slugs-slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
pympp: patch
---

Updated `examples/api-server/README.md` to replace references to the external `purl` tool with the `pympp` client (`python -m mpp.fetch`) and corrected the `secret_key` documentation to reflect that it is read from the `MPP_SECRET_KEY` env var rather than auto-generated.
7 changes: 3 additions & 4 deletions examples/api-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ A FastAPI server with payment-protected endpoints using the Machine Payments Pro

- Python 3.10+
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
- [purl](https://purl.tempo.xyz/) for testing paid endpoints

## Installation

Expand Down Expand Up @@ -47,10 +46,10 @@ curl http://localhost:8000/free
# {"message":"This content is free!"}
```

**Paid endpoint** (use purl to handle payment automatically):
**Paid endpoint** (use the pympp client to handle payment automatically):

```bash
purl http://localhost:8000/paid
python -m mpp.fetch http://localhost:8000/paid
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace this invocation with an actual installed fetch entrypoint

In the documented uv sync setup for examples/api-server, this command is not runnable: that environment only installs pympp[tempo,server] (examples/api-server/pyproject.toml:6-10), while the fetch client in this repo is a separate example package that exposes a fetch script (examples/fetch/pyproject.toml:8-9). There is no mpp.fetch module under src/mpp, so users following the README will hit ModuleNotFoundError instead of exercising the paid endpoint.

Useful? React with 👍 / 👎.

# {"message":"This is paid content!","payer":"0x...","tx":"0x..."}
```

Expand All @@ -77,7 +76,7 @@ server = Mpp.create(

`Mpp.create()` sets up the payment handler with smart defaults:
- **realm** auto-detected from environment (`MPP_REALM`, `VERCEL_URL`, etc.)
- **secret_key** auto-generated and persisted to `.env`
- **secret_key** read from `MPP_SECRET_KEY` env var (or passed explicitly)
- **currency** and **recipient** configured once on the method

### Charging
Expand Down