happy_platform_sdk 1.0.0
happy_platform_sdk: ^1.0.0 copied to clipboard
A powerful Flutter client for the Happy Platform BaaS. Enables fluent, type-safe access to your self-hosted Firestore-like database.
1.0.0 #
🚀 Major Release: Authentication & Firestore Overhaul #
This release introduces a complete rework of the Authentication and Firestore services, delivering a more robust, flexible, and developer-friendly SDK.
Authentication
HappyPlatform.auth()is now the single entry point for all authentication operations.Auth.signInWithGoogle(): Added support for Google Sign-In via ID Tokens for easier integration.Auth.registerWithEmailAndPassword()&Auth.signInWithEmailAndPassword(): Parameters are now optional, enabling more flexible flows when supported by your backend.Auth.updateUserByPassword(): New method to update user profile details (name, email, password) by verifying with current credentials (no JWT required).Auth.deleteUserByPassword(): New method to delete a user account by verifying with email and password (no JWT required).Auth.fetchAllUsers(): Retrieve a list of all public user profiles.- Existing JWT-based methods (
updateProfile(),deleteAccount()) remain available for token-based flows. - Admin API (
Auth.admin().listUsers(),updateUser(),deleteUser()) remains for secure server-side use with adeveloperAuthToken.
Firestore
HappyPlatform.firestore()is now the entry point for all Firestore operations.- Collection
add(): Reworked to usePOSTrequests to the collection path, letting the server generate and return document IDs (REST-compliant). - Query Enhancements: The
Queryclass now supports advanced filters (whereclauses), sorting (orderBy), limits, and offsets more robustly. Firestore.runTransaction(): Added support for atomic read/write transactions.WriteBatch: Introduced for grouping multiple write operations into a single atomic commit.DocumentSnapshot.data(): Now returnsnullif the document doesn’t exist, improving null safety.- Streaming Snapshots:
QueryandDocumentReferencenow providesnapshots()methods for real-time updates via polling (WebSocket support planned for future versions). - Type Safety: Improved
CollectionReference.withConverterfor strongly typed custom object mapping.
General Improvements
- Simplified Initialization:
HappyPlatform.initialize()now setsapiBaseUrlinternally, removing the need to pass it manually. - Error Handling: Better error messages via
HappyPlatformExceptionandAuthException, with improvedDioExceptionhandling. - Refactoring: Codebase cleaned up for consistency, readability, and maintainability.