Dart SDK
Package: kataflax_client_sdk. Same surface as @kataflax/sdk: project auth, collections, queries, files. It does not manage orgs or schemas.
import 'package:kataflax_client_sdk/kataflax_client_sdk.dart';
void main() async { final client = KataflaxClient( baseUrl: 'https://api.tefily.com', projectId: 'YOUR_PROJECT_ID', );
final auth = await client.auth.login( password: 'password', ); print('Logged in as ${auth.user['email']}');
final posts = client.collection('posts');
final created = await posts.create({ 'title': 'Hello World', 'status': 'draft', });
final all = await posts.list(page: 1, pageSize: 20); print('Total posts: ${all.total}');
final post = await posts.get(created['_id'] as String); await posts.update(post['_id'] as String, {'title': 'Updated title'}); await posts.delete(post['_id'] as String);
client.close();}final auth = await client.auth.register( password: 'secret123', extraFields: {'name': 'Jane'},);
client.setToken('eyJhbGciOi...'); // platform JWT or PAT — not for mobile/web clientsfinal profile = await client.auth.me();Server-side verify:
final backend = KataflaxClient( baseUrl: 'https://api.tefily.com', projectId: 'YOUR_PROJECT_ID', serviceToken: 'kfxs_…', // never ship to a client app);final checked = await backend.auth.verify(incomingUserJwt);Errors
Section titled “Errors”try { await client.collection('posts').get('nonexistent');} on KataflaxException catch (e) { print(e.statusCode); print(e.message); print(e.errors);}