Quickstarts
Publisher Flutter
Install the Flutter source SDK, open the wall and verify a reward.
Install the SDK
Use Flutter 3.41+, Dart 3.11+, Android API 24+ or iOS 13+. Add krin_sdk as a local path dependency pointing to packages/sdk-flutter, then run flutter pub get. The package is a source preview and is not published on pub.dev.
Prepare your server handoff
Create an app and placement in the publisher workspace. Enable the matching integration and obtain its public SDK key and approved HTTPS wall URL. Your authenticated backend issues a fresh, single-use JWS HS256 assertion for each open: issuer, audience KRIN, opaque subject, app, placement, issued/expiry times and nonce, with a maximum five-minute lifetime. Signing keys stay on your server. Pass the user's actual consent choices and policy version, including refusal.
Open your first wall
Call this from your rewards action after obtaining fresh handoff data. Parameters belong to your host app. Keep the SDK alive until the presentation closes and release it on teardown.
Dart
import 'package:flutter/material.dart';
import 'package:krin_sdk/krin_sdk.dart';
Future<void> showRewards(
BuildContext context,
String publicAppKey,
Uri authorizedWallUrl,
KrinHandoffProvider freshHandoff,
void Function() refreshBalance,
) async {
final sdk = KrinSdk.init(
appKey: publicAppKey,
wallUrl: authorizedWallUrl,
handoffProvider: freshHandoff,
onReward: (_) => refreshBalance(),
);
try {
await openKrinWall(context, sdk, fullScreen: true);
} finally {
await sdk.dispose();
}
}Configure the host
Set Android minSdk to 24, add INTERNET permission and disable cleartext traffic. Use iOS 13+ with standard ATS. The native wrapper inherits your Material theme. HTTPS wall URLs cannot contain credentials, a query or a fragment. Authorize the exact wall origin in allowedOrigins because the embedded host runs at that origin.
Verify rewards on your server
Client events update presentation only. Credit from authenticated server callbacks, deduplicate by transactionId and link reversals to originalTransactionId. A ready event means bridge readiness; authenticated confirms the session exchange. After a reward signal, refresh your server-owned balance. Close before changing users and request a fresh assertion before reopening.