Skip to main content
Version: Next

Quickstart

Get up and running with the Eixam Flutter SDK in five steps.

1. Add the dependency

For the 0.1.0 release, use the agreed Eixam release tag provided during release handoff:

dependencies:
eixam_connect_flutter:
git:
url: https://github.com/eixam-tech/eixam-sdk-flutter
ref: <agreed-0.1.0-release-tag>
path: packages/eixam_connect_flutter

2. Import the package

import 'package:eixam_connect_flutter/eixam_connect_flutter.dart';

3. Bootstrap the SDK

Your backend must generate the signed session — the app secret must never live in the mobile client.

Standard environment

final sdk = await EixamConnectSdk.bootstrap(
const EixamBootstrapConfig(
appId: 'partner-app',
environment: EixamEnvironment.sandbox,
initialSession: EixamSession.signed(
appId: 'partner-app',
externalUserId: 'partner-user-123',
userHash: 'signed-session-hash',
),
),
);

Custom environment

final sdk = await EixamConnectSdk.bootstrap(
const EixamBootstrapConfig(
appId: 'partner-app',
environment: EixamEnvironment.custom,
customEndpoints: EixamCustomEndpoints(
apiBaseUrl: 'https://partner-api.example.com',
mqttUrl: 'ssl://partner-mqtt.example.com:8883',
),
),
);

:::info Signed session The backend generates userHash by signing externalUserId with the app secret using HMAC-SHA256. See Identity Signing for implementation examples. :::

4. Request permissions

Permission requests are explicit host-app decisions — the SDK does not trigger them on its own:

await sdk.requestLocationPermission();
await sdk.requestNotificationPermission();
await sdk.requestBluetoothPermission();

5. Use the SDK

Trigger an SOS:

await sdk.triggerSos(
const SosTriggerPayload(
message: 'Need assistance',
triggerSource: 'button_ui',
),
);

Connect a device:

await sdk.connectDevice(pairingCode: '123456');

Create an emergency contact:

await sdk.createEmergencyContact(
name: 'Mountain Rescue Desk',
phone: '+34600000000',
email: 'rescue@example.com',
);

Important notes

warning
  • initialSession is optional. If provided, its appId must match the bootstrap appId.
  • Do not pass customEndpoints to non-custom environments.
  • Bootstrap does not request permissions or trigger UX-sensitive actions.