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#
| Behaviour | Live key | Test key |
|---|---|---|
| SMS sending | Real | None |
| Credit debit | Yes (credits_charged) | Simulated |
INSUFFICIENT_CREDITS | Possible | Never (balance not checked) |
test_code (POST /otp/send) | Never | Present |
| Validation, limits, idempotency, errors | Yes | Yes, 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 methodNever 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 atest.pingevent.