Sphere SDK Connect Example is a collection of runnable code examples demonstrating how applications can integrate with a Sphere wallet using the Sphere Connect protocol.
The project addresses the need for applications to interact with user wallets—reading balances, sending tokens, and signing messages—without ever accessing private keys. Sphere Connect is a typed RPC protocol where a dApp runs a ConnectClient and communicates with a wallet running a ConnectHost through a message transport. The examples show four distinct integration patterns: a browser-based dApp where users approve transactions in real time, a Node.js service that drives a user's wallet over WebSocket, a bot that operates its own wallet autonomously without approval prompts, and a backend service that authenticates users via signature verification without moving any funds.
Developers should choose an example based on two axes: whose wallet the application uses and what operations it needs to perform. Browser and Node.js examples suit applications that need to move a user's tokens with per-action approval. The bot example is appropriate for autonomous agents like tipping bots, faucets, or game NPCs that control their own funds. The backend-auth example is recommended for applications requiring authenticated user identity—such as games with leaderboards or ownership tracking—but no token movement or custody. The project notes that the bot example runs its own wallet directly rather than using Connect, and the backend example only verifies signatures rather than moving funds.
The project maintains strict SDK version requirements, enforcing a minimum dependency floor at the handshake stage to prevent incompatible clients from attempting connection. The examples are written in TypeScript and include detailed README files for each integration pattern, with specific guidance on testing configurations such as using an iframe path when testing against the hosted wallet rather than a local instance.