DocumentationAPI v1 · 1.3.0

Get started

Test mode

lsk_test_ keys: sandbox with no sending and no debit, OTP code returned, package test tools.

A lsk_test_… key uses a simulated provider. Responses have the same shape as in production, so you can build and test a complete integration without spending credits.

Differences from production#

BehaviourLive keyTest key
SMS sendingRealNone
Credit debitYes (credits_charged)Simulated
INSUFFICIENT_CREDITSPossibleNever (balance not checked)
test_code (POST /otp/send)NeverPresent
Validation, limits, idempotency, errorsYesYes, identical

Test OTP end to end#

With a test key, POST /otp/send returns test_code: pass it to POST /otp/verify to test the whole flow without a phone.

$otp = $client->otp->send('243812345678');
$code = $client->isTestMode() ? $otp->testCode() : $_POST['code']; // testCode() is a method

Never show test_code to an end user or send it to a browser in production: it only exists in test mode, but misplaced conditional code always ends up leaking.

Package test tools#

  • Every SDK exposes the key mode: isTestMode() (PHP), isTestMode (Node.js), is_test_mode (Python), IsTestMode (.NET), isTestMode() (Java).
  • Laravel: Labyrinthe::fake() swaps the client for an in-memory fake, with assertions (assertSmsSentTo, assertOtpSent…) and simulated failures (failNextRequestWithFeatureDisabled).
  • Webhooks: every SDK provides sign() to build a valid signature in your tests; the client area Test button sends a test.ping event.