Skip to content

Provider Quick Reference

Quick reference card for OTP provider configuration in Unisync.

Implementation Status

Provider TypeStatusDocumentation
SMS✅ ImplementedFull Guide
Email⏳ Coming SoonStatus Info

SMS Provider Setup (BulkSMS Bangladesh)

1. Environment Variables

env
BULK_SMS_API_KEY=your_api_key_here
BULK_SMS_SECRET_KEY=your_secret_key_here
BULK_SMS_CALLER_ID=your_sender_id

2. Get Credentials

  1. Visit BulkSMSBD.net
  2. Create account
  3. Purchase credits
  4. Copy API credentials

3. Test Configuration

bash
# Send test OTP
curl -X POST http://localhost:9201/api/v1/otp/send \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "identifier": "+8801712345678",
      "identifierType": "PHONE",
      "purpose": "LOGIN"
    }
  }'

4. Check Logs

bash
tail -f server/logs/combined-*.log | grep "SMS provider"

Expected output:

Initializing SMS provider: bulksmsbd
SMS sent successfully via BulkSMSBD

Common Issues

IssueSolution
SMS provider configuration not foundApply Hasura migrations
BULK_SMS_API_KEY is requiredAdd to .env file
BulkSMSBD rejected SMSCheck credentials & credits
Rate limit exceededWait 1 hour or adjust limits

Configuration Architecture

┌─────────────────────────────────────────┐
│         OTP Send Request                │
└───────────────┬─────────────────────────┘


┌─────────────────────────────────────────┐
│    identifierType === "PHONE"?          │
└───────────┬─────────────────────────────┘
            │ Yes

┌─────────────────────────────────────────┐
│    Query settings.config table          │
│    identifier = 'OTP_PROVIDER'          │
└───────────┬─────────────────────────────┘


┌─────────────────────────────────────────┐
│    Load SMS Provider                    │
│    (bulksmsbd)                          │
└───────────┬─────────────────────────────┘


┌─────────────────────────────────────────┐
│    Read Environment Variables           │
│    BULK_SMS_API_KEY, etc.               │
└───────────┬─────────────────────────────┘


┌─────────────────────────────────────────┐
│    Send SMS via Provider API            │
└─────────────────────────────────────────┘

Environment Variables Reference

Active Variables

env
# OTP Configuration
OTP_EXPIRY_MINUTES=5
OTP_MAX_ATTEMPTS=5
OTP_LENGTH=6

# Rate Limits
OTP_SEND_LIMIT_PER_HOUR=3
OTP_SEND_LIMIT_PER_IP_PER_HOUR=10
OTP_VERIFY_LIMIT_PER_15MIN=5

# BulkSMS Bangladesh (Active)
BULK_SMS_API_KEY=required
BULK_SMS_SECRET_KEY=required
BULK_SMS_CALLER_ID=required

Not Yet Active

env
# Email (not implemented)
EMAIL_PROVIDER=console
RESEND_API_KEY=
SENDGRID_API_KEY=

# Future SMS providers (not implemented)
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
AWS_SNS_REGION=

Message Templates

Login

Your UniSync login verification code is {OTP}.
Valid for 5 minutes. Do not share this code with anyone.

Signup

Your UniSync signup verification code is {OTP}.
Valid for 5 minutes. Do not share this code with anyone.

Password Reset

Your UniSync password reset code is {OTP}.
Valid for 5 minutes. Do not share this code with anyone.

Rate Limits

EndpointLimitWindow
Send OTP (per identifier)3 requests1 hour
Send OTP (per IP)10 requests1 hour
Verify OTP5 requests15 minutes

Support

Released under the MIT License.