Health & Server Setup
The Dart SDK includes small helpers for common server bootstrap flows.
Health check
final health = await client.healthCheck();
print('${health.status} — v${health.version} (api=${health.apiVersion})');healthCheck() is useful for showing diagnostics in your app, or verifying connectivity.
For example, you can display the version/build information in a hidden “Diagnostics” screen.
Detect first-time setup
Some deployments require initial setup (create the first admin user).
final status = await client.checkSetupStatus();
if (status.needsSetup) {
print('Needs setup: ${status.message}');
}Only run setup flows in trusted environments. For public apps, treat setup as an admin-only operation.
Perform setup
await client.serverSetup(
const ServerSetupRequest(
username: 'admin',
password: 'AdminPass123!',
rootPassword: 'RootPass456!',
email: 'admin@example.com',
),
);If setup fails, surface a generic UI message and log the server error for debugging.
Next
Last updated on