Status: ✅ VERIFIED - SDK is platform-agnostic
The Dorisio SDK is designed to be embeddable in any platform. This document verifies that the client implementation does not hardcode Dorisio-specific schemas or assumptions.
All domain models are defined as generic interfaces in src/types/models.ts:
-
User: Generic user model with
id,email,name,role,verified- No Dorisio-specific fields
- Extensible via TypeScript interface merging
- Can represent any user system (fans, creators, admins)
-
Creator: Generic creator model with
id,userId,username,displayName,bio,avatar,verified,isPublic- No Dorisio-specific assumptions
- Can represent any content creator on any platform
- Earnings fields (
totalEarnings,pendingBalance) are generic
-
Wallet: Generic wallet model with
id,userId,publicKey,name,verified- Platform-agnostic Stellar wallet structure
- No Dorisio-specific linking logic
-
Transaction: Generic transaction model with
id,fromUserId,creatorId,amount,message,status,stellarTxHash- Represents any payment transaction
- No Dorisio-specific fields
All client methods follow a generic pattern:
// Generic GET endpoint
export async function getCreator(
this: DorisioClient,
creatorId: string
): Promise<Creator>
// Generic POST endpoint with configurable request data
export async function createTip(
this: DorisioClient,
data: CreateTipRequest
): Promise<Transaction>
// Generic transaction building (any Stellar payment)
export async function buildPaymentTransaction(
this: DorisioClient,
tipId: string,
data: BuildTransactionRequest
): Promise<BuildTransactionResponse>Key characteristics:
- Methods accept generic IDs (strings) without format assumptions
- Request/response DTOs are decoupled from backend implementation
- HTTP routes are configurable via
baseUrlin client config - No implicit Dorisio database schema assumptions
The HttpClient class in src/http/http-client.ts is completely generic:
- Accepts any base URL
- Makes standard HTTP requests (GET, POST, PATCH, DELETE)
- Handles authentication via Bearer tokens
- No hardcoded endpoints or business logic
Authentication is platform-agnostic:
interface AuthState {
isAuthenticated: boolean;
token?: string;
userId?: string;
createdAt: number;
}- Token-based (JWT or any standard bearer token)
- No Dorisio-specific auth provider assumptions
- Works with any backend auth system
All React hooks are generic and don't assume Dorisio schemas:
useCreateTip: Generic tip creation with configurable creator referencesuseWallet: Generic wallet managementuseCreatorBalance: Generic earnings queriesuseTransactionHistory: Generic transaction paginationTipForgeProvider: Generic context that wraps anyDorisioClient
Client configuration is minimal and generic:
interface ClientConfig {
baseUrl: string; // Any API URL
token?: string; // Any bearer token
timeout?: number; // Standard HTTP timeout
}- Any platform with a REST API matching the documented endpoints
- Any project using React (via hooks) or vanilla JavaScript
- Any authentication system using bearer tokens
- Any Stellar network (testnet, mainnet, standalone)
- REST API endpoints matching the transaction/wallet routes (documented in backend)
- Bearer token authentication support
- Standard HTTP request/response format (JSON)
- Optional: User/Creator/Wallet models matching the generic interfaces
- Dorisio database schema
- Dorisio-specific User/Creator models
- Dorisio authentication system
- Any Dorisio-specific integrations
const client = new DorisioClient({
baseUrl: 'https://api.payment-platform.com',
token: userToken,
});
// Works with any creator and user IDs
const tip = await client.createTip({
creatorId: 'external-creator-id',
amount: 50,
message: 'Support message',
});const client = new DorisioClient({
baseUrl: 'https://streaming-platform.com/api',
token: streamerToken,
});
// Tip creators on the streaming platform
const wallet = await client.listWallets(streamerId);
const earnings = await client.request('GET', '/creators/earnings');const client = new DorisioClient({
baseUrl: 'https://game-api.example.com',
token: playerToken,
});
// Support game creators with tips
const tip = await client.createTip({
creatorId: gameCreatorId,
amount: 100,
});- ✅ No hardcoded
/dorisio/path prefixes - ✅ No Dorisio-specific field mappings
- ✅ No Dorisio organization assumptions
- ✅ Generic HTTP client
- ✅ Generic domain models
- ✅ Configurable base URL
- ✅ Standard Bearer token auth
- ✅ React-agnostic core client
- ✅ Generic React hooks
- ✅ No external dependencies on Dorisio infrastructure
Platforms can extend the generic types:
// In consuming platform
interface CustomUser extends User {
platformId: string;
customField: string;
}
interface CustomCreator extends Creator {
platformSpecificData: any;
}The SDK achieves the design goal of being "embeddable in any platform" by:
- Using generic interfaces for all domain models
- Making HTTP requests to configurable endpoints
- Supporting any bearer token authentication
- Providing a framework-agnostic core client
- Offering optional React hooks for convenience
- Not assuming any Dorisio-specific implementation details
The SDK can be integrated into any platform with minimal customization.