Skip to content

Flutter

The Dart client is kataflax_client_sdk and is not published to pub.dev (publish_to: none). From this monorepo:

dependencies:
kataflax_client_sdk:
path: ../sdk
import 'package:kataflax_client_sdk/kataflax_client_sdk.dart';
final client = KataflaxClient(
baseUrl: const String.fromEnvironment(
'TEFILY_API_URL',
defaultValue: 'https://api.tefily.com',
),
projectId: const String.fromEnvironment('TEFILY_PROJECT_ID'),
);
await client.auth.login(email: email, password: password);
final items = await client.collection('posts').list(page: 1, pageSize: 20);

Pass --dart-define=TEFILY_PROJECT_ID=... at build time, or load from your own config. Do not --dart-define a service token into a mobile/web client.

Store the project JWT however you already persist session secrets (for example flutter_secure_storage), then client.setToken on launch if you cache it.

See Dart SDK, End-user auth, and Security.