Welcome to the complete documentation for @pubflow/flowfull-client - the universal HTTP client for Flowfull backends.
Flowfull Client is a developer-friendly, type-safe HTTP client designed specifically for connecting to Flowfull backends. It provides:
- ✅ Chainable Query Builder - Build complex queries with ease
- ✅ 14 Filter Operators - Powerful filtering capabilities
- ✅ Auto Session Management - Works seamlessly with Pubflow auth
- ✅ TypeScript First - Complete type safety
- ✅ Universal - Works with React, React Native, Next.js, and vanilla JS
- ✅ Retry Logic - Automatic retry on failures
- ✅ Interceptors - Customize requests and responses
- ✅ Multiple Instances - Connect to multiple APIs
- Getting Started - Quick start guide and basic usage
- Installation - How to install the package
- Response Handling ⭐ NEW - How to access and use API response values
- Filter Operators - Complete guide to all 14 filter operators
- Query Builder - Master the chainable query builder API
- Configuration - Configure your client for your needs
- Error Handling - Handle errors like a pro
- Payments API Universal ⭐ NEW - Complete reference for all 33 payment methods
- React Payments ⭐ NEW - Payment integration for React apps
- React Native Payments ⭐ NEW - Payment integration for React Native/Expo apps
- Next.js Payments ⭐ NEW - Payment integration for Next.js apps
- Payments Examples ⭐ NEW - 6 complete usage scenarios
- React Native - Using Flowfull Client in React Native/Expo apps
- React - Using Flowfull Client in React apps (coming soon)
- Next.js - Using Flowfull Client in Next.js apps (coming soon)
- Backend API Structure ⭐ For Backend Devs - How to structure your API for Flowfull Client compatibility
- Full-Stack Examples - Complete frontend + backend integration examples
- Advanced Features - Universal API compatibility, platform detection, sessionless requests
- Future Features - Roadmap and upcoming features (cache, file upload, offline support)
- TypeScript - Get the most out of TypeScript (coming soon)
- Session Management - Advanced session management patterns (coming soon)
- Interceptors - Customize requests and responses (coming soon)
- Multiple Instances - Working with multiple APIs (coming soon)
- API Reference - Complete API documentation
- Migration Guide - Migrating from other HTTP clients
import { createFlowfull } from '@pubflow/flowfull-client';
// Create client
const api = createFlowfull('https://api.myapp.com');
// Simple request
const users = await api.get('/users');
// Complex query
const products = await api
.query('/products')
.search('laptop')
.where('status', 'active')
.where('price', 'gte', 500)
.where('price', 'lte', 2000)
.sort('price', 'asc')
.page(1)
.limit(20)
.get();
if (products.success) {
console.log('Products:', products.data);
console.log('Total:', products.meta?.total);
}Build complex queries with a fluent, chainable API:
const response = await api
.query('/users')
.where('status', 'active')
.where('age', 'gte', 18)
.search('john')
.sort('name', 'asc')
.page(1)
.limit(20)
.get();- Comparison:
eq,ne,gt,gte,lt,lte - String:
like,ilike,startsWith,endsWith - Array:
in,notIn - Null:
isNull,isNotNull - Range:
between,notBetween
import { gte, inOp, isNotNull } from '@pubflow/flowfull-client';
const users = await api
.query('/users')
.where('age', gte(21))
.where('role', inOp(['admin', 'moderator']))
.where('verified_at', isNotNull())
.get();Works seamlessly with Pubflow authentication:
// Automatically detects session from localStorage/AsyncStorage
const api = createFlowfull('https://api.myapp.com');
// All requests include session header automatically
const profile = await api.get('/profile');Full type safety with generics:
interface User {
id: string;
name: string;
email: string;
}
const response = await api.get<User[]>('/users');
if (response.success) {
// TypeScript knows response.data is User[]
response.data.forEach(user => {
console.log(user.name);
});
}Automatic retry on network errors and 5xx responses:
const api = createFlowfull('https://api.myapp.com', {
retry: {
attempts: 3,
delay: 1000,
exponentialBackoff: true
}
});Customize requests and responses:
// Add timestamp to all requests
api.addRequestInterceptor(async (config) => {
config.headers['X-Request-Time'] = new Date().toISOString();
return config;
});
// Log all errors
api.addResponseInterceptor(async (response) => {
if (!response.success) {
console.error('API Error:', response.error);
}
return response;
});Works everywhere JavaScript runs:
- ✅ React - Web applications
- ✅ React Native - Mobile apps (iOS/Android)
- ✅ Expo - Managed React Native apps
- ✅ Next.js - Server and client components
- ✅ Node.js - Backend applications
- ✅ Bun - Modern JavaScript runtime
- ✅ Vanilla JS - No framework needed
@pubflow/flowfull-client
├── Core Client (FlowfullClient)
├── Query Builder (QueryBuilder)
├── Session Manager (SessionManager)
├── Request Handler (RequestHandler)
├── 14 Filter Operators
├── TypeScript Types
└── Utility Functions
- Start Here: Getting Started Guide
- Learn Filtering: Filter Operators
- Master Queries: Query Builder
- Platform Guide: React Native | React | Next.js
- Advanced: TypeScript | Interceptors
const products = await api
.query('/products')
.search(searchTerm)
.where('category', category)
.where('price', 'gte', minPrice)
.where('price', 'lte', maxPrice)
.where('in_stock', true)
.sort('price', 'asc')
.page(page)
.limit(20)
.get();const activeUsers = await api
.query('/users')
.where('status', 'active')
.where('verified_at', isNotNull())
.where('role', notIn(['banned', 'suspended']))
.sort('created_at', 'desc')
.get();const stats = await api
.query('/analytics/events')
.where('event_type', 'purchase')
.where('created_at', between(startDate, endDate))
.param('group_by', 'date')
.param('aggregate', 'sum,count,avg')
.get();We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE for details.
Ready to get started? → Getting Started Guide