load static method

Future<Fingerly> load({
  1. required String apiKey,
  2. String endpoint = '',
  3. ConsentState consent = ConsentState.pending,
  4. int? playIntegrityCloudProjectNumber,
})

Configure the SDK and return a client.

The key is a publishable SDK key from the dashboard, and it is safe in a shipped binary — it is scoped to the app identifiers you list. A secret key is refused when it arrives from a client, so pasting one in does not work by design.

consent is the state to start from, ConsentState.pending by default: call setConsent once the app's consent tool has an answer, and until it is ConsentState.granted, identify and collect throw FingerlyConsentException. Pass ConsentState.granted here only once collection is permitted for this user: they consented, or the law that applies to them does not require consent. A GDPR lawful basis such as legitimate interest is not enough on its own. Loading collects and sends nothing, whatever the consent, and the state passed here replaces whatever the native SDK held before.

playIntegrityCloudProjectNumber is Android only: your Google Cloud project number, the one linked to the app in Play Console, to add Play Integrity verdicts to events (server ADR 0026). It takes effect only when the app also links io.fingerly:fingerly-play-integrity and registers its provider; without it the number is ignored and nothing fails. Ignored on iOS. Null, the default, leaves Play Integrity off. Anything that is not a positive number throws an ArgumentError before anything is configured.

Implementation

static Future<Fingerly> load({
  required String apiKey,
  String endpoint = '',
  ConsentState consent = ConsentState.pending,
  int? playIntegrityCloudProjectNumber,
}) =>
    configure(
      FingerlyConfig(
        apiKey: apiKey,
        endpoint: endpoint,
        consent: consent,
        playIntegrityCloudProjectNumber: playIntegrityCloudProjectNumber,
      ),
    );