Solve the challenge
Solve the proof-of-work challenge and get a Turnstile token on the client, and find the Shield SDK for your platform.
Solving the Challenge
These fields come from the Step 1 response.
Before calling Step 2, your client solves PoW only when challengeRequired is true and obtains a Turnstile token only when turnstile.required is true. Shield SDKs handle the client-side work across all platforms.
Always branch on challengeRequired before you solve. A pipeline with PoW switched off — or one in dev mode with bypassPoW — returns no challenge, difficulty or challengeToken, so calling the solver unconditionally throws on undefined.
import { solvePow, getTurnstileToken } from '@akedly/shield';
// Solve PoW (uses Web Worker automatically) — only when the server asks for it
let powSolution;
if (data.challengeRequired) {
const { nonce } = await solvePow(data.challenge, data.difficulty);
powSolution = { challengeToken: data.challengeToken, nonce };
}
// Get Turnstile token (if required)
const turnstileToken = data.turnstile?.required
? await getTurnstileToken(data.turnstile.siteKey)
: undefined;
Shield SDK Documentation
Each platform has a dedicated SDK page with full API reference, installation guides, and integration examples. View Shield SDKs
Algorithm Reference
The PoW solver computes SHA256(challenge + ":" + nonce) and checks if the resulting hex digest starts with difficulty leading zeros. The nonce increments from 0 until a valid hash is found.
hash = SHA256("a1b2c3d4...:" + "42") // hex digest
valid = hash.startsWith("000") // difficulty = 3
Shield SDKs
Official Shield SDKs handle Proof-of-Work solving and Turnstile token retrieval across all platforms. Each SDK manages threading, Web Workers, or isolates automatically.
| Platform | Package | Install | Repository |
|---|---|---|---|
| Web / JavaScript | @akedly/shield | npm / CDN | NPM |
| Flutter / Dart | akedly_shield | GitHub (pubspec git:) | GitHub |
| iOS / Swift | AkedlyShield | SPM (GitHub URL) | GitHub |
| Android / Kotlin | akedly-shield-kotlin | GitHub (JitPack) | GitHub |
| React Native | @akedly/shield | npm | NPM |
The same SDKs also launch passkeys
Beyond PoW and Turnstile, each Shield SDK can launch the hosted V1.2 passkey ceremony.
React Native uses /pk in a react-native-webview <WebView> or in-app browser instead
of a native launcher. See each SDK page for platform setup, and use the
V1.2 Passkeys guide for the shared endpoint,
NO_PASSKEY, proof, and callback contracts. Use the
AI agents and LLMs to give your coding agent the Akedly skill, then
ask it for a greenfield integration or to add passkeys to an existing V1.2 OTP flow.
