tinybase_client 0.1.0
tinybase_client: ^0.1.0 copied to clipboard
Flutter/Dart SDK for the TinyBase backend — email/OAuth auth, automatic JWT refresh, and generic collection CRUD. Not affiliated with the JavaScript TinyBase library (tinybase.org).
tinybase_client #
Client Flutter/Dart pour le backend TinyBase (auth, JWT, CRUD collections).
Pas affilié à la bibliothèque JavaScript TinyBase.
Install #
flutter pub add tinybase_client
Usage #
import 'package:tinybase_client/tinybase_client.dart';
final client = TinyBaseClient(baseUrl: 'https://your-api.example.com');
await client.auth.login(email: 'a@b.c', password: 'secret');
await client.auth.restore(); // au démarrage de l'app
final page = await client.collection('notes').list();
await client.collection('notes').create({'title': 'Hello'});
Features #
- Auth email/password
- OAuth Discord / Microsoft (browser) et Google / Apple (idToken natif)
- Refresh JWT automatique après un
401 - CRUD
/api/collections/<name>/records - Persistance tokens via
SharedPreferences(ouInMemoryTokenStorepour les tests)
Backend #
Ce package parle à une instance tinybase_server.
En prod (Railway), pointe DB_PATH vers un volume persisté.
License #
MIT