Users are foundational to Sage Protocol’s decentralized social ecosystem, maintaining consistent global identities across all Sage-enabled applications, yet interacting uniquely within each.
Utilize Sage SDK’s built-in React hooks (useUser, useChannel, usePost) and the provided SageProvider context for explicitly streamlined state management and operations.
Copy
import { SageProvider, useUser } from '@sageprotocol/sdk/react';function App() { return ( <SageProvider appId="your-app-id" channelRegistryId="your-channel-registry-id" network="testnet" > <UserProfile /> </SageProvider> );}function UserProfile() { const { create, update, follow } = useUser(); // Explicitly manage user state and operations here}export default App;