@tremendous/help
    Preparing search index...

    Function createDeviceDetection

    • Creates a device detection function that initializes the Fingerprint agent with the given API key. The agent is lazily started on first call.

      When no API key is provided (e.g. in test/development environments), returns a fake result to avoid hitting the Fingerprint API.

      Parameters

      • apiKey: string | undefined
      • options: DeviceDetectionOptions = {}
        • legacyBuild

          Pass import.meta.env.LEGACY === true.

      Returns () => Promise<{ device: Device }>

      when the agent fails to start or identify. Callers must see the rejection — createFingerprintCollector relies on it to record the failure and block redemption outside an outage.