This project demonstrates how to integrate the Dynamic embedded wallet with a full-stack app using both a modern React (Next.js) frontend and a traditional PHP backend.
Check out the live demo: https://dynamic-example-1j906rf4h-spark-eng.vercel.app
- A fully functional Dynamic-enabled frontend
- NFT minting, account abstraction, and JWT-based auth flows
- Dockerized for easy setup
- Verifies
DYNAMIC_JWT_TOKENcookie on backend - Demonstrates mint gating using validated sessions
- Dockerized PHP + Apache service
NEXT_PUBLIC_DYNAMIC_ENV_ID="your-dynamic-environment-id"
NEXT_PUBLIC_DYNAMIC_API_BASE_URL="https://app.example.com/api/v0"DYNAMIC_ENV_ID="your-dynamic-environment-id"Make sure the Dynamic environment ID is identical in both files so the frontend and backend verify against the same workspace.
You'll find your environment ID in the Dynamic dashboard under Developer > API.
Use Docker Compose to spin up both services:
docker-compose upServices:
- Frontend (Next.js) → http://localhost:3000
- Backend (PHP) → http://localhost:8080
- Auth cookies must be enabled in the Dynamic dashboard
- Frontend requests to backend must use
credentials: 'include' - Cookie name is:
DYNAMIC_JWT_TOKEN - AA uses ZeroDev (legacy 4337 mode)