simplr_ai

Simplr's fraud, RUM and feature-flag SDK for Flutter. One package gives you device fingerprinting, behavioral biometrics, real user monitoring, order-fraud scoring, and locally-evaluated feature flags β€” all keyed by a single API key.

  • πŸ“± Device fingerprinting β€” stable device signals + persistent device ID
  • ⌨️ Behavioral biometrics β€” keystroke/touch dynamics to tell humans from bots
  • βœ… Fraud check β€” score a user/event via /v1/check with signals attached
  • πŸ“Š Real User Monitoring β€” sessions, screens, and drop-off (User Flows)
  • πŸ›’ Order fraud & profiles β€” identify users and score transactions
  • 🚩 Feature flags β€” local, deterministic evaluation (rollouts, targeting, rules)
  • πŸ€– AI delegation β€” OAuth-like delegation tokens for AI agents

Full docs: https://simplr-docs-three.vercel.app/sdks/flutter/overview

Install

dependencies:
  simplr_ai: ^1.2.0
import 'package:simplr_ai/simplr_ai.dart';

Use a public key (pk_live_… / pk_test_…) on the client. Keep secret keys on your backend.

Feature flags

final flags = SimplrFlags();
await flags.initialize(apiKey: 'pk_live_xxx', environment: 'live');
flags.setUser('user_123'); // optional; falls back to the device ID

if (flags.isEnabled('new-checkout')) {
  // show the new checkout
}

// Per-call context for rules / targeting:
flags.isEnabled('new-checkout', userId: 'user_123', attributes: {'plan': 'growth'});

Flags are fetched once on initialize() and refreshed periodically, then evaluated locally β€” no network call per check.

Real User Monitoring

final rum = SimplrRUM();
await rum.initialize(apiKey: 'pk_live_xxx', applicationId: 'my-app');

MaterialApp(
  navigatorObservers: [SimplrScreenObserver(rum)], // automatic screen tracking
  // ...
);

Device signals & biometrics

final sdk = SimplrFraud();
final signals = await sdk.collect(context); // device + behavior signals
// send signals to your backend to score via POST /v1/check

Fraud check

Score a user or event directly from the client. check() auto-attaches the collected device fingerprint and behavioral biometrics, so you only pass the identity/event fields you have.

final sdk = SimplrFraud(
  config: SimplrFraudConfig(apiKey: 'pk_live_xxx'),
);

final result = await sdk.check(
  CheckInput(email: 'user@example.com', eventType: 'login'),
  context: context, // optional, improves screen-derived signals
);

print('${result.riskLevel} (${result.riskScore})'); // e.g. "low (12.0)"
if (result.riskLevel == 'high' || result.riskLevel == 'critical') {
  // step up auth
}

AI delegation

OAuth-like delegation tokens that let an AI agent act on a user's behalf. Mint a token, hand it to the AI, and list / inspect / revoke it later. Exposed as sdk.ai, or construct SimplrAI standalone.

final ai = sdk.ai; // or SimplrAI(config: SimplrAIConfig(apiKey: 'pk_live_xxx'))

// Create a delegation β€” the token is returned only once.
final delegation = await ai.createDelegation(
  CreateDelegationOptions(
    userId: 'user_123',
    binding: BindingMode.verifiedDevice,
    expiresInDays: 7,
    fingerprintHash: (await sdk.collectDeviceSignals(context)).fingerprint,
  ),
);
print(delegation.token); // give this to the AI agent

// List, inspect and revoke.
final active = await ai.list('user_123');
final info = await ai.get(delegation.delegationId);
await ai.revoke(delegation.delegationId, reason: 'rotated');

// On logout, revoke everything for the user.
final revoked = await ai.revokeAllForUser('user_123', reason: 'logout');

The interactive popup/OAuth connect() flow is web-only and is intentionally omitted on Flutter to avoid a heavy native dependency. Use createDelegation directly on mobile/desktop.

Order fraud & profiles

final profiles = SimplrProfiles(
  config: SimplrProfilesConfig(apiKey: 'pk_live_xxx'),
);
await profiles.identify('customer_123');
final result = await profiles.submitOrder(/* OrderInput */);

In-app feedback

Let users record their screen + voice, annotate a screenshot, and file a bug/feature request straight to your Simplr feedback board. Gemini transcribes the narration and drafts the title, type, priority and summary.

Drop-in widget:

final captureKey = GlobalKey();
final feedback = SimplrFeedback(apiKey: 'pk_live_xxx', applicationId: 'my-app');

// Wrap the UI you want screenshots of:
SimplrCaptureBoundary(captureKey: captureKey, child: HomeScreen());

// Place the launcher (e.g. as a floatingActionButton or in a Stack):
SimplrFeedbackButton(feedback: feedback, captureKey: captureKey);

Programmatic (build your own UI):

final recorder = SimplrScreenRecorder();
await recorder.start(microphone: true);   // OS shows its capture-consent prompt
// ...user narrates...
final recording = await recorder.stop();  // FeedbackAttachment (video/mp4)

final shot = await captureBoundary(captureKey);
final annotated = await showSimplrAnnotator(context, shot!);

await feedback.submit(SubmitFeedbackInput(
  type: FeedbackType.bug,
  title: 'Checkout 404',
  attachments: [
    recording,
    FeedbackAttachment(kind: FeedbackAttachmentKind.annotatedScreenshot, bytes: annotated!),
  ],
));

Point at a custom gateway with SimplrFeedback(apiKey: ..., endpoint: 'https://api.example.com').

Native setup (required for screen recording)

Screenshot + annotation work out of the box. Screen + mic recording uses the native capture APIs via flutter_screen_recording:

Android β€” add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

Requires minSdkVersion 24+.

iOS β€” add to ios/Runner/Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>Record voice narration with your feedback</string>

iOS screen recording uses ReplayKit (iOS 12+). If you don't need screen video, pass enableRecording: false to SimplrFeedbackButton β€” screenshot, annotation, and submit still work with no native setup.

Configuration

All modules accept an optional baseUrl (feedback uses endpoint) for an approved custom gateway. Production uses the default endpoint.

License

Commercial software β€” see LICENSE.

Libraries

simplr_ai
Simplr Fraud SDK for Flutter