Quickstart
1. Add the dependency
For the planned 0.1.0 release, use the agreed EIXAM release tag when it is 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
Signed Session And Backend Responsibilities
- your partner backend stores the app secret
- the app secret never belongs in the client
- your backend generates or obtains
userHashforappId+externalUserId externalUserIdmust be unique per app- the mobile app receives a signed session and passes it to the SDK
- the same signed identity is reused by the SDK for both HTTP and MQTT/runtime transport
- partner production flows must implement the server-side signing step securely within the partner backend
HTTP auth remains:
X-App-IDX-User-IDAuthorization: Bearer <userHash>
MQTT auth now uses:
username = sdk:<appId>:<externalUserId>password = <userHash>- no
Bearerprefix in MQTT
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',
),
),
);
The mqttUrl/websocketUrl field name stays stable for now even when the actual broker URI uses ssl://, tls://, tcp://, ws://, or wss:// depending on environment and transport support.
4. Request permissions explicitly from your host app
await sdk.requestLocationPermission();
await sdk.requestNotificationPermission();
await sdk.requestBluetoothPermission();
5. Use the SDK
Trigger 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
initialSessionis optional- if you provide
initialSession, itsappIdmust match the bootstrapappId - do not pass
customEndpointsto non-custom environments - bootstrap does not request permissions or trigger UX-sensitive actions for you