@nimbleflux/fluxbase-sdk 2026.3.6-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,146 @@
1
+ # @nimbleflux/fluxbase-sdk
2
+
3
+ Official TypeScript/JavaScript SDK for Fluxbase - Backend as a Service.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@nimbleflux/fluxbase-sdk.svg)](https://www.npmjs.com/package/@nimbleflux/fluxbase-sdk)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Features
9
+
10
+ - **Type-safe** - Full TypeScript support with generated types
11
+ - **Database Queries** - PostgREST-compatible query builder with filters, ordering, pagination
12
+ - **Aggregations** - Count, sum, avg, min, max with GROUP BY support
13
+ - **Batch Operations** - Efficient multi-row insert, update, delete
14
+ - **Authentication** - JWT-based auth with automatic token refresh
15
+ - **Realtime** - WebSocket subscriptions to database changes
16
+ - **Storage** - File upload/download with S3 compatibility
17
+ - **RPC** - Call PostgreSQL functions directly
18
+ - **Lightweight** - Zero dependencies except fetch polyfill
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install @nimbleflux/fluxbase-sdk
24
+ # or
25
+ yarn add @nimbleflux/fluxbase-sdk
26
+ # or
27
+ pnpm add @nimbleflux/fluxbase-sdk
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ ```typescript
33
+ import { createClient } from "@nimbleflux/fluxbase-sdk";
34
+
35
+ // Create a client
36
+ const client = createClient({
37
+ url: "http://localhost:8080",
38
+ auth: {
39
+ autoRefresh: true,
40
+ persist: true,
41
+ },
42
+ });
43
+
44
+ // Authentication
45
+ await client.auth.signUp({
46
+ email: "user@example.com",
47
+ password: "secure-password",
48
+ });
49
+
50
+ // Query data
51
+ const { data } = await client
52
+ .from("products")
53
+ .select("*")
54
+ .eq("category", "electronics")
55
+ .gte("price", 100)
56
+ .execute();
57
+
58
+ // Aggregations
59
+ const stats = await client
60
+ .from("products")
61
+ .count("*")
62
+ .groupBy("category")
63
+ .execute();
64
+
65
+ // Realtime subscriptions
66
+ client.realtime
67
+ .channel("table:public.products")
68
+ .on("INSERT", (payload) => console.log("New:", payload.new_record))
69
+ .subscribe();
70
+
71
+ // File upload
72
+ await client.storage.from("avatars").upload("user-123.png", file);
73
+ ```
74
+
75
+ ## Documentation
76
+
77
+ 📚 **[Complete Documentation](../../docs/docs/sdks/getting-started.md)**
78
+
79
+ ### Core Guides
80
+
81
+ - **[Getting Started](../../docs/docs/sdks/getting-started.md)** - Installation, configuration, and basic usage
82
+ - **[Database Operations](../../docs/docs/sdks/database.md)** - Queries, filters, aggregations, batch operations, and RPC
83
+ - **[React Hooks](../../docs/docs/sdks/react-hooks.md)** - React integration with `@fluxbase/sdk-react`
84
+
85
+ ### API Reference
86
+
87
+ - **[TypeScript API Docs](../../docs/static/api/sdk/)** - Auto-generated from source code
88
+
89
+ ## Browser & Node.js Support
90
+
91
+ - **Browsers**: All modern browsers with ES6+ and Fetch API
92
+ - **Node.js**: v18+ (native fetch) or v16+ with `cross-fetch` polyfill
93
+
94
+ ## TypeScript Support
95
+
96
+ Fully typed with TypeScript. Define your schemas for complete type safety:
97
+
98
+ ```typescript
99
+ interface Product {
100
+ id: number;
101
+ name: string;
102
+ price: number;
103
+ category: string;
104
+ }
105
+
106
+ const { data } = await client.from<Product>("products").select("*").execute();
107
+ // data is typed as Product[]
108
+ ```
109
+
110
+ ## Examples
111
+
112
+ Check out working examples in the [`/example`](../example/) directory:
113
+
114
+ - Vanilla JavaScript/TypeScript
115
+ - React with hooks
116
+ - Next.js integration
117
+ - Vue 3 integration
118
+
119
+ ## React Integration
120
+
121
+ For React applications, use [`@nimbleflux/fluxbase-sdk-react`](../sdk-react/) for hooks and automatic state management:
122
+
123
+ ```bash
124
+ # npm
125
+ npm install @nimbleflux/fluxbase-sdk @nimbleflux/fluxbase-sdk-react @tanstack/react-query
126
+
127
+ # pnpm
128
+ pnpm add @nimbleflux/fluxbase-sdk @nimbleflux/fluxbase-sdk-react @tanstack/react-query
129
+ ```
130
+
131
+ See the **[React Hooks Guide](../../docs/docs/sdks/react-hooks.md)** for details.
132
+
133
+ ## Contributing
134
+
135
+ Contributions are welcome! Please read our [Contributing Guide](../../CONTRIBUTING.md) for details.
136
+
137
+ ## License
138
+
139
+ MIT © Fluxbase
140
+
141
+ ## Links
142
+
143
+ - [Documentation](../../docs/docs/sdks/getting-started.md)
144
+ - [API Reference](../../docs/static/api/sdk/)
145
+ - [GitHub](https://github.com/nimbleflux/fluxbase)
146
+ - [Issues](https://github.com/nimbleflux/fluxbase/issues)