Using the Headless SDK, requests can be easily customized to set a specific expiry, adjust the OTP length, and select a preferred delivery channel such as WhatsApp, SMS, or Viber for phone number authentication.

After successfully integrating the OTPLESS Flutter Headless SDK, you can set the following custom parameters:

Custom Expiry

Headless request can be customized with a custom expiry.

final Map<String, dynamic> headlessRequest = {
  "phone": "phoneNumber",
  "countryCode": "countryCode",
  "expiry": "expiryInSeconds", // e.g., 300 for 5 minutes
};

_otplessHeadlessPlugin.start(headlessRequest);

Custom OTP length

Headless request can be customized with OTP length — either 4 or 6.

final Map<String, dynamic> headlessRequest = {
  "phone": "phoneNumber",
  "countryCode": "countryCode",
  "otpLength": "otpLength", // 4 or 6
};

_otplessHeadlessPlugin.start(headlessRequest);

Custom Delivery Channel

Headless request can be customized with a preferred delivery channel like WHATSAPP, SMS, or VIBER.

final Map<String, dynamic> headlessRequest = {
  "phone": "phoneNumber",
  "countryCode": "countryCode",
  "deliveryChannel": "deliveryChannel", // "WHATSAPP", "SMS", or "VIBER"
};

_otplessHeadlessPlugin.start(headlessRequest);