Quick summary
Gx402 provides x402 integration examples and server middleware so teams can accept in-app payments (miniapps) and in-game purchases from engine builds (Unity/Unreal) running inside Farcaster or as standalone games. We are not shipping a proprietary SDK — instead, you get:- Engine-native examples
- A recommended Express middleware pattern
- Deployment notes for reliable x402 payments (
create → sign → confirm → finalize)
Prerequisites
- Node.js 18+ and a package manager (
pnpm,npm, oryarn) - Farcaster uses it’s In-App wallet connection so you don’t need any external wallet to connect
- x402 provider account & API keys (from your x402 provider)
- Unity (2021+) or Unreal (4.27+/5.x) for engine builds intended to run inside Farcaster or as standalone apps
- Basic knowledge of wallet signing (EIP-191 or EIP-712) and server-side HMAC/secret handling
We are still working on the flow of Unity Integrations for Miniapp, We will be providing the Unity WebGL
Integration Kit soon
Farcaster Miniapp Integration Flow
- Farcaster Miniapps provide native in-app wallet connections (e.g., Wagmi, Privy, or custom connectors).
- The Unity WebGL build runs seamlessly inside the Farcaster frame, maintaining wallet context and session continuity.
- All in-game and external transactions follow the same x402-compliant payment logic, powered by the Gx402 middleware.
- Gx402 acts as a facilitator layer, verifying Solana transactions and unlocking protected APIs or in-game assets post-payment.
- This architecture ensures cross-platform compatibility, allowing the same Unity game to run on Farcaster, Telegram, or browser-based miniapps with minimal code changes.
Server
Unity Implementation
For now we will be using the same approach for build as of Unity Integration sectionWe will be providing the code snippet to connect the In-App wallet inside the game as repo is still under construction
