@quantabit/friend-sdk
v1.0.2
Published
QuantaBit Friend SDK - Friend management, intimacy levels, blocklist, and grouping
Maintainers
Readme
@quantabit/friend-sdk
QuantaBit Friend SDK - Friend management, intimacy levels, and request handling
📦 Installation
npm install @quantabit/friend-sdk
# or
yarn add @quantabit/friend-sdk🚀 Quick Start
1. Setup Provider
import { FriendProvider } from "@quantabit/friend-sdk";
import "@quantabit/friend-sdk/styles.css";
function App() {
return (
<FriendProvider
apiUrl="https://api.example.com/v1"
token="your-auth-token"
onAccept={(friend) => console.log("Friend added:", friend)}
>
<YourComponent />
</FriendProvider>
);
}2. Using Components
import { FriendCard, AddFriendButton } from '@quantabit/friend-sdk';
// Friend card
<FriendCard
friend={friendData}
showIntimacy
onMessage={(friend) => openChat(friend)}
onProfile={(friend) => viewProfile(friend)}
/>
// Add friend button
<AddFriendButton
userId="user_12345"
status="stranger"
onSuccess={() => console.log('Request sent')}
/>3. Using Hooks
import { useFriend } from "@quantabit/friend-sdk";
function MyComponent() {
const {
friends, // Friend list
requests, // Friend requests
blocklist, // Blocklist
loadFriends, // Load friends
sendRequest, // Send request
acceptRequest, // Accept request
unfriend, // Remove friend
blockUser, // Block user
} = useFriend();
return <div>...</div>;
}💚 Intimacy Levels
// Level configuration
🤝 Acquaintance - Level 1
💚 Familiar - Level 2
💙 Close Friend - Level 3
💜 Best Friend - Level 4📄 License
MIT License
🌐 Brand & Links
- Official Mainnet: QuantaBit Chain
- Developer Platform: Developer Platform
- Open Platform: Open Platform
- Payment Platform: Pay Platform
- Feedback: Feedback
