lighthouse_north_client 0.2.2
lighthouse_north_client: ^0.2.2 copied to clipboard
SDK Flutter oficial para integrar o app do cliente à plataforma Lighthouse North de disparo push: registro de device token com evidência de consentimento (LGPD), heartbeat e opt-out fácil e gratuito. [...]
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-defineor.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