InAppify

Configure at application startup

Kotlin/Flutter 0.2.1 configure takes a public key and optional customer ID; guest, authenticated and Web startup examples.

Configure once from the application's session owner during startup. Disable purchases until it succeeds. Do not repeat configure in widget builds, Composable bodies, or every screen opening.

Mobile inputs

InputRequirementMeaning
apiKeyRequiredPublic Inappify app key, not a secret REST key
appUserIdentifierOptional; null by defaultStable account ID authenticated by your application

The SDK reads host version metadata; the server resolves store and RSA from the app. market, marketKey, country, appVersion, forceVersion and protocol selectors are not public mobile configure inputs. Save the store RSA in dashboard app settings.

Flutter: guest or existing account

These are alternatives, not two calls on every startup:

import 'package:inappify_sdk/inappify_sdk.dart';

Future<void> configureAlternatives() async {
  // Guest/retained session:
  await InappifySdk.configureResult(apiKey: 'YOUR_PUBLIC_APP_KEY');
  // Alternative when host authentication already established this user:
  await InappifySdk.configureResult(
    apiKey: 'YOUR_PUBLIC_APP_KEY', appUserIdentifier: 'customer_123',
  );
}

Before operations in main, call WidgetsFlutterBinding.ensureInitialized(). Convenience configure(...) returns bool; configureResult(...) preserves failure and snapshot. Use startup UI and explicit retry state if network/account recovery takes time.

Kotlin: optional identity

import com.inappify.sdk.*

suspend fun configureMobile(
    client: InappifyV2Client,
    apiKey: String,
    customerId: String? = null,
): InappifyResult<Unit> = client.configure(
    InappifyOptions(apiKey = apiKey, appUserIdentifier = customerId)
)

Omit customerId for guest/retained startup; provide a stable known ID for an authenticated account. Inspect InappifyResult.Success/Failure. Client creation is separate from configure; do not create a new client for each account transition.

Omitted identity is not logout

The SDK may reuse a saved identity, including a signed-in account. It creates Anonymous only when appropriate without a retained session. Do not manufacture an anonymous prefix or generate a new customer every launch. Use logIn and logOut for transitions.

Prefetch and recovery

The SDK owns offering prefetch and startup recovery. Do not warm offerings with getOfferings in Android Application.onCreate. Configure success does not mean every recovery operation finished; follow the relevant purchase result or later snapshot.

Web has a separate contract

JavaScript InAppify.configure({apiKey, country?, appVersion?, ...}) returns a client; appVersion is the host version. Use a Public Web App Key. Flutter Web also needs the JS provider first. A client-supplied ID is not Web authentication; use Identity Tickets or OTP.

Flutter's configureAuthenticatedWebSessionResult has Web-specific ticket-provider, expected-identity and appVersion inputs. Do not add those to mobile configure.

Customer identity · Platform differences