Lighthouse North SDK for Flutter

Add push notifications to your Flutter app with built-in LGPD consent evidence, heartbeat, and easy opt-out.

Features

  • πŸ“± Push registration β€” device token + consent evidence in one call
  • πŸ”” Heartbeat β€” keeps device alive on the platform (24h, auto-restart)
  • πŸšͺ Opt-out β€” one method, always free, never throws
  • πŸ›‘οΈ LGPD by design β€” collects only platform, token, contactRef, consent. Nothing else
  • πŸ”’ No secrets in logs β€” tokens are always masked
  • πŸ“¦ Zero bloat β€” only dependency is http (no Firebase bundled)

Installation

dependencies:
  lighthouse_north_client: ^0.2.0

Quick Start

1. Get your App Key

In your Lighthouse North dashboard: Apps β†’ Keys. The key looks like ak_....

Keep it in environment config (--dart-define or .env), never hardcoded.

2. Initialize

import 'package:lighthouse_north_client/lighthouse_north_client.dart';

final client = await LighthouseNorthClient.init(
  appKey,
  apiBaseUrl: 'https://lighthousenorth.com.br',
);

3. Register for Push

Call this from a user action (button tap), not on app start:

final result = await client.registerForPush(
  contactRef: 'user-123',        // your user ID (optional)
  policyVersion: '2026-09',      // consent policy version
);
await client.startHeartbeat();

4. Handle Opt-out

Always show an opt-out option in your app settings:

await client.optOut(); // removes device from platform

API

Method What it does
LighthouseNorthClient.init(key, url) Initialize and resume heartbeat
registerForPush(contactRef, policyVersion) Register token + consent
startHeartbeat() / stopHeartbeat() 24h keep-alive
optOut() Remove device (best-effort, never throws)
onPermissionRevoked Auto-cleanup when user denies notifications

Requirements

  • Flutter 3.0+ / Dart 3.0+
  • Android: minSdk 21 Β· iOS: iOS 12+
  • Your app must have Firebase configured (SDK uses FCM token, but doesn't bundle Firebase)

Privacy

This SDK collects exactly: device platform, FCM token, your contact reference, and consent version. No IP, no user agent, no advertising ID, no app data. See our Privacy Policy.

License

MIT

Libraries

lighthouse_north_client
SDK Flutter (codinome β€” nome de publicaΓ§Γ£o a definir pelo dono) para a plataforma LighthouseNorth de disparo push.