Installation

This guide walks you through adding the KLP Flutter SDK to your application.

Installation

This guide walks you through adding the KLP Flutter SDK to your application.

Before you begin

  • Complete SDK onboarding and confirm your organization has repository access
  • Ensure your application meets the system requirements
  • Have a Flutter development environment configured on your machine or CI pipeline

Step 1 — Declare the dependency

Add the SDK to your application's pubspec.yaml. Always reference a release
tag
rather than a branch:

dependencies:
  klp_flutter_sdk:
    git:
      url: https://github.com/kaizen-dev-team/klp-flutter-sdk.git
      ref: v1.0.0

Version pinning
Pinning to a tag such as v1.0.0 ensures reproducible builds across
developers and CI environments. When you are ready to adopt a newer release,
update ref to the new tag and run your regression tests before deploying.

Step 2 — Configure repository access

The SDK repository is private. A fine-grained personal access token is
provided to your organization during onboarding. Configure it on each developer
machine and CI environment before running flutter pub get.

The token must never be committed to source control, pubspec.yaml, or build
logs. Store it in your organization's secret manager for CI pipelines.

Local development

export GITHUB_TOKEN=your_token_here
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"

Replace your_token_here with the token supplied by your account team. Keep the
HTTPS URL in pubspec.yaml from Step 1.

CI pipelines

Add GITHUB_TOKEN as a pipeline secret and run the same git config command at
the start of each job, before flutter pub get.

Step 3 — Resolve dependencies

From your application project root:

flutter pub get

This command fetches the SDK at the pinned tag, registers the Flutter plugin,
and resolves Dart dependencies. Native libraries are included in the repository —
no separate download step is required.

iOS note
Dependency resolution alone does not link the iOS native framework. Complete
Step 5 — iOS setup after this step.

Step 4 — Verify platform requirements

Confirm your application targets meet the SDK minimums:

PlatformConfigurationRequired value
iOSios/Podfileplatform :ios'13.0'
Androidandroid/app/build.gradleminSdk24

Step 5 — iOS setup

Install CocoaPods dependencies after flutter pub get:

cd ios && pod install && cd ..

The SDK plugin includes the required native iOS framework. You do not need to add
a separate entry to your application's Podfile.

When building from Xcode, open Runner.xcworkspace, not Runner.xcodeproj.

Step 6 — Android setup

No additional Gradle configuration is required. The SDK links the Android native
library through Flutter's standard plugin autolinking.

Step 7 — Verify the installation

Add a minimal initialization call to confirm the plugin is linked correctly:

import 'package:flutter/foundation.dart';
import 'package:klp_flutter_sdk/klp_flutter_sdk.dart';

Future<void> bootstrapKlp() async {
  await Klp.instance.initialize(
    KlpInitializeConfig(
      environment: kReleaseMode ? KlpEnvironment.prod : KlpEnvironment.test,
      debugMode: !kReleaseMode,
      showDebugScreen: false,
    ),
  );
}

Invoke this once after WidgetsFlutterBinding.ensureInitialized() in your
application entry point. See Usage page for the complete integration
lifecycle.

Continuous integration

Configure your CI pipeline to authenticate before dependency resolution:

git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
flutter pub get
cd ios && pod install && cd ..

Troubleshooting

SymptomCauseResolution
Git error or 404 during pub getMissing or expired tokenVerify GITHUB_TOKEN is set; contact your account team for a new token
MissingPluginExceptionStale build artifactsRun flutter clean, flutter pub get, then pod install
iOS link error for the SDKOutdated CocoaPods integrationRun pod deintegrate && pod install in ios/; open .xcworkspace
Android build error for the SDKIncomplete dependency resolutionRun flutter clean and flutter pub get; contact support if the issue persists
KlpNotInitializedExceptionSDK method called before initializationEnsure initialize() completes before any other SDK call
KlpSecurityException on a physical deviceDevice failed integrity verificationTest on a standard, non-modified device
KLP_LAUNCH_ERRORNo active view controller or ActivityCall launch() from a visible screen after the first frame; confirm the user session is established

Security recommendations

  • Store the token in a secret manager — never in source code
  • Pin ref to an immutable release tag
  • Set debugMode: false and showDebugScreen: false in production builds
  • Build release artifacts with --obfuscate --split-debug-info


Did this page help you?