@fanz/sdk
Official SDK for the FANZ Creator Platform Ecosystem. Connect your platform to all central FANZ services.
Installation
npm install @fanz/sdk
Quick Start
import { FanzSDK } from '@fanz/sdk';
const fanz = new FanzSDK({
platformId: 'your-platform-id',
platformSecret: process.env.FANZ_SECRET,
});
// SSO Authentication
app.get('/login', (req, res) => {
res.redirect(fanz.sso.getLoginUrl({ returnTo: '/dashboard' }));
});
// Verify user session
app.use(fanz.authMiddleware());
// Check subscription status
const sub = await fanz.money.checkSubscription(userId, creatorId);
if (sub.isSubscribed) {
// Show premium content
}
Available Clients
fanz.sso - Authentication
Single sign-on authentication across all FANZ platforms.
getLoginUrl(options) - Generate SSO login URL
handleCallback(token) - Process login callback
verifyToken(token) - Verify user session
middleware() - Express auth middleware
requireAuth() - Require authenticated user
requireCreator() - Require creator access
fanz.media - Media Hub
Upload, transcode, and stream media content.
getUploadUrl(options) - Get presigned upload URL
getCdnUrl(assetId, options) - Get CDN URL with transforms
transcodeVideo(assetId, options) - Start video transcoding
getStreamUrl(assetId) - Get streaming URL
getStorageUsage(creatorId) - Check storage quota
fanz.vault - Compliance & Profiles
2257 compliance, KYC verification, and creator profiles.
check2257(creatorId) - Check 2257 compliance status
getKYCStatus(creatorId) - Get KYC verification status
submitKYC(creatorId, documents) - Submit KYC documents
getCreatorProfile(creatorId) - Get creator profile
getModelReleases(creatorId) - Get model releases
fanz.money - Payments
Transaction tracking, wallets, and payouts.
reportTransaction(tx) - Report a transaction
checkSubscription(userId, creatorId) - Check subscription
getCreatorWallet(creatorId) - Get wallet balance
getEarnings(creatorId, options) - Get earnings report
requestPayout(creatorId, options) - Request payout
fanz.brain - AI Services
Content moderation, AI captions, and personal bots.
moderateContent(options) - AI content moderation
generateCaption(options) - Generate AI caption
createBot(creatorId, config) - Create personal AI bot
chatWithBot(options) - Chat with creator bot
suggestPricing(creatorId, options) - AI pricing suggestions
fanz.landing - Discovery
Cross-platform discovery and creator profiles.
searchCreators(options) - Search creators across platforms
getFeaturedCreators() - Get featured creators
getSwitchUrl(options) - Generate platform switch URL
getTrending() - Get trending content
generateDeepLink(options) - Generate deep links
Service Endpoints
sso: https://sso.fanz.website
media: https://media.fanz.website
vault: https://vault.fanz.website
money: https://money.fanz.website
brain: https://brain.fanz.website
landing: https://landing.fanz.website
TypeScript Support
Full TypeScript support with complete type definitions included.
import { FanzSDK, User, Creator, Transaction } from '@fanz/sdk';
const user: User = await fanz.sso.getUser(userId);
const creator: Creator = await fanz.vault.getCreatorProfile(creatorId);
FANZ Ecosystem SDK v1.0.0 |
Package Info