Termii SMS
Send SMS and OTP to Nigerian phone numbers via Termii.
Connect Termii
- Sign up at termii.com
- Go to Settings → API Keys and copy your key
- In NaijaBase: Project → Integrations → Termii → Connect
- Enter your API key and Sender ID
Send an OTP
const nb = createClient(URL, KEY)
// Send OTP to phone number
await nb.integrations.messaging.termii.sendOTP({
phone: '+2348012345678'
})
// User receives: "Your verification code is 482910.
// Valid for 10 minutes."
// Verify the code the user entered
const result = await nb.integrations.messaging.termii.verifyOTP({
phone: '+2348012345678',
code: userEnteredCode
})
if (result.verified) {
// Phone verified ✅ — create account, log in, etc.
}
Custom OTP message
await nb.integrations.messaging.termii.sendOTP({
phone: '+2348012345678',
message: 'Your MyApp code is {{code}}. Valid 10 mins.'
// {{code}} is replaced with the actual OTP
})
Send a plain SMS
await nb.integrations.messaging.termii.sendMessage({
phone: '+2348012345678',
message: 'Your order has been confirmed. Track at myapp.com'
})
Check your balance
const { balance, currency } = await nb.integrations.messaging.termii.getBalance()
console.log(`Balance: ${balance} ${currency}`)
Check message status
const status = await nb.integrations.messaging.termii.getStatus(messageId)
Phone number format
Always use international format:
+2348012345678 ✅ correct
08012345678 ❌ will fail
Sender ID
Your Sender ID is the name displayed as the sender of the SMS.
Use N-Alert for testing (pre-approved by Termii).
For production, register your own Sender ID at termii.com → Settings → Sender ID. Approval takes 1–3 business days.
OTP security
- OTPs expire after 10 minutes
- Maximum 3 verification attempts before the code is invalidated
- Each OTP is stored server-side — never returned to the client
- Call
sendOTPagain to issue a fresh code