Shield SDKs

Akedly Shield SDKs handle Proof-of-Work challenge solving and Cloudflare Turnstile token retrieval for the V1.2 REST API. Each SDK manages threading automatically -- Web Workers in browsers, Isolates in Dart, async/await in Swift, and coroutines in Kotlin.


Platform SDKs

PlatformPackageInstallPoWTurnstile
Web / JavaScript@akedly/shieldnpm / CDNWeb Worker (auto)getTurnstileToken()
Flutter / Dartakedly_shieldGitHub (pubspec git:)IsolateAkedlyTurnstile widget
iOS / SwiftAkedlyShieldSPM (GitHub URL)async/awaitAkedlyTurnstile (WKWebView)
Android / Kotlinakedly-shield-kotlinGitHub (JitPack / local module)CoroutinesAkedlyTurnstile (WebView)
React Native@akedly/shieldnpmBatched main-threadBridge page

PoW Algorithm

All Shield SDKs implement the same Proof-of-Work algorithm. The solver computes SHA256(challenge + ":" + nonce) and checks whether the hex digest starts with the required number of leading zeros.

challenge = "a1b2c3d4e5f6..."        // 64-char hex string from server
difficulty = 4                        // number of leading hex zeros required

nonce = 0
loop:
  hash = SHA256(challenge + ":" + String(nonce))
  if hash starts with "0000":         // difficulty = 4 leading zeros
    return nonce
  nonce++

The difficulty is set per-pipeline in the Akedly dashboard. Higher difficulty increases computational cost, providing stronger bot protection at the expense of longer solve times. Adaptive difficulty mode automatically adjusts based on traffic patterns.


Turnstile Integration

When turnstile.required is true in the challenge response, the client must obtain a Cloudflare Turnstile token before calling the Send endpoint.

Each platform handles Turnstile differently:

  • Name
    Web
    Type
    getTurnstileToken()
    Description

    Creates a hidden Turnstile widget in the DOM, resolves with the token, and cleans up automatically.

  • Name
    Flutter
    Type
    AkedlyTurnstile widget
    Description

    Flutter widget that loads a Turnstile bridge page via WebView. Add it to your widget tree and receive the token via onToken callback.

  • Name
    iOS
    Type
    AkedlyTurnstile.getToken()
    Description

    Uses a hidden WKWebView to load the Turnstile bridge page at turnstile.akedly.io. Returns the token via async/await.

  • Name
    Android
    Type
    AkedlyTurnstile.getToken()
    Description

    Creates an invisible WebView to load the Turnstile bridge page. Returns the token via coroutine.

  • Name
    React Native
    Type
    Bridge page
    Description

    Uses a WebView pointing to turnstile.akedly.io to obtain the token. See the React Native SDK page for details.

Turnstile tokens expire after 2 minutes. Generate a new token for each OTP request.


Was this page helpful?