Documentation Index
Fetch the complete documentation index at: https://docs.ofauth.com/llms.txt
Use this file to discover all available pages before exploring further.
npm install @ofauth/onlyfans-sdk
Quick Example
import { createOFAuthClient } from '@ofauth/onlyfans-sdk';
const client = createOFAuthClient({ apiKey: 'your-api-key' });
const account = await client.account.whoami();
console.log(account.id, account.permissions);
Details
| TypeScript |
|---|
| Package | @ofauth/onlyfans-sdk |
| Repository | onlyfans-sdk-typescript |
| Init | createOFAuthClient() |
| Architecture | Nested client with namespaces |
| Types | Inline types, full IntelliSense |
| Pagination | Async iterators (for await) |
| Dependencies | None (uses fetch) |
Features
Full Type Safety
Generated from the OpenAPI spec — response types, request params, and error codes are all typed.
Async Iterators
for await over any paginated list automatically.
Proxy Support
Call any OnlyFans endpoint directly through the OFAuth proxy.
Media Upload
Automatic chunking and progress callbacks.
Usage Examples
List subscribers
const subscribers = await client.access.listSubscribers({
connectionId: 'conn_xxx',
limit: 50
});
for (const sub of subscribers.data) {
console.log(sub.username, sub.subscribedAt);
}
Send a message
await client.access.sendMessage({
connectionId: 'conn_xxx',
userId: '12345',
text: 'Hello from OFAuth!'
});
Error handling
import { OFAuthAPIError } from '@ofauth/onlyfans-sdk';
try {
await client.access.getUser({ connectionId: 'conn_xxx', userId: '999' });
} catch (err) {
if (err instanceof OFAuthAPIError) {
console.error(err.status, err.code, err.message);
}
}