Skip to content

Add example client snippets (curl, fetch, axios, x402) #24

Description

@Miracle656

Background

Lens is designed to be consumed by external developers — but the README does not show how to make a paid request with the x402 header. Without examples, developers do not know how to structure the payment or what response to expect.

What to build

A "Usage Examples" section in the README with curl, fetch, and a Node.js example showing the full x402 payment flow.

Key files

  • README.md — add examples here

Suggested execution

git checkout -b docs/usage-examples
  1. curl example showing the 402 response (no payment header)
  2. curl example with X-PAYMENT header showing 200 + price JSON
  3. Node.js example using @x402/client for auto-payment
  4. GET /status unauthenticated health check
  5. GraphQL price query example

Example commit message:
docs: add curl, fetch, and Node.js usage examples with x402 payment flow

Acceptance criteria

  • The 402 → payment → 200 flow illustrated
  • @x402/client Node.js example shown
  • All code examples are syntactically valid

Drips Wave · Complexity: Trivial · 100 points
Comment below to request assignment. PR must include Closes #[this issue].

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions