sphere-connect
v1.0.9
Published
Google OAuth-based account abstraction SDK for Sphere wallets
Maintainers
Readme
Sphere Connect SDK
The modern standard for Google-powered account abstraction on Movement Network.
@sphere/connect is a developer-first SDK that enables users to create and restore secure, non-custodial wallets using their existing Google accounts. By leveraging deterministic key derivation and session-bound ephemeral keys, it provides an enterprise-grade onboarding experience without the complexity of seed phrases.
✨ Key Features
- Google Native: Zero-barrier entry using Google OAuth2.
- Deterministic Wallets: The same Google user always gets the same wallet address.
- Keyless Experience: No seed phrases, no browser extensions—just sign in.
- Self-Custodial: Private keys are derived client-side and never touch a server.
- Modern React UI: Pre-built, responsive, and professional
SphereModal. - Cross-Platform: Built-in support for standard redirect flows (Mobile & Safari friendly).
🚀 Quick Start
1. Installation
npm install sphere-connect2. Configuration
Set up your SDK configuration with your Google Client ID and optional redirect URI.
// src/config/sphere.ts
export const SPHERE_CONFIG = {
network: 'testnet', // or 'mainnet'
googleClientId: 'YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com',
redirectUri: window.location.origin + '/callback', // Optional for redirect flow
};3. Setup Provider
Wrap your application with the SphereProvider.
import { SphereProvider } from '@sphere/connect';
import { SPHERE_CONFIG } from './config/sphere';
export default function App() {
return (
<SphereProvider config={SPHERE_CONFIG}>
<MainLayout />
</SphereProvider>
);
}4. Connect Wallet
Use the SphereModal or the useSphere hook to initiate a connection.
import { useSphere, SphereModal } from '@sphere/connect';
function LoginButton() {
const [isOpen, setIsOpen] = useState(false);
const { isAuthenticated, wallet } = useSphere();
if (isAuthenticated) {
return <div>Connected: {wallet.getAddress()}</div>;
}
return (
<>
<button onClick={() => setIsOpen(true)}>Connect with Google</button>
<SphereModal isOpen={isOpen} onClose={() => setIsOpen(false)} />
</>
);
}📖 Documentation
For detailed integration guides, on-chain transaction examples, and advanced configuration, visit docs.sphere.network.
🔐 Security
- Client-Side Derivation: Keys are derived using PBKDF2 with Google's unique user ID (sub) as a seed.
- Secure Storage: Sessions are managed using encrypted local storage.
- Ephemeral Sessions: Supports short-lived sessions for maximum security in public environments.
📄 License
MIT © Sphere
