Examples
Examples
Working examples demonstrating Lucid Agents capabilities.
The @lucid-agents/examples package contains working examples that demonstrate real-world usage patterns. Each example is a complete, runnable script.
Running examples
# Clone the repository
git clone https://github.com/daydreamsai/lucid-agents.git
cd lucid-agents
# Install dependencies
bun install
# Build packages
bun run build:packages
# Run an example
bun run packages/examples/src/core/full-agent.tsExample categories
Core
Full agent setup with HTTP, payments, identity, and streaming
Identity
ERC-8004 on-chain identity registration and registry operations
Agent-to-Agent
Multi-agent composition with discovery and task operations
Wallet
Wallet connectors including thirdweb Engine integration
Payment Policies
Spending limits, rate limiting, and recipient filtering
Stripe Destination Mode
Dynamic payTo resolution using Stripe PaymentIntents on Base
Scheduler
Automated agent hiring and interval-based execution
Environment setup
Most examples require environment variables. Create a .env file based on the example's requirements:
# Common variables
FACILITATOR_URL=https://facilitator.x402.org
PAYMENTS_RECEIVABLE_ADDRESS=0x...
NETWORK=ethereum
AGENT_WALLET_PRIVATE_KEY=0x...
# Stripe destination mode (alternative to PAYMENTS_RECEIVABLE_ADDRESS)
PAYMENTS_DESTINATION=stripe
STRIPE_SECRET_KEY=sk_test_...
# For identity examples
RPC_URL=https://eth.llamarpc.com
CHAIN_ID=1
AGENT_DOMAIN=my-agent.example.comWhat you'll learn
| Example | Key concepts |
|---|---|
| Full Agent | Complete agent with all extensions, streaming entrypoints |
| Identity Quick Start | Simplest path to on-chain registration |
| A2A Integration | Agent discovery, task operations, multi-turn conversations |
| Thirdweb Wallets | Enterprise wallet management with thirdweb Engine |
| Payment Policies | Spending limits, allowlists, blocklists |
| Stripe Destination | Dynamic payTo resolution with Stripe PaymentIntents |
| Scheduler | Automated agent invocation with payments |