Authyo Docs
  1. Native/Mobile SDKs
Authyo Docs
  • 🐶 Walk through Authyo
  • Error Codes
  • About Pricing
  • APIs
    • Send OTP
      GET
    • Send OTP
      POST
    • Verify OTP
      GET
    • Verify Token
      POST
  • Web SDKs
    • JavaScript
    • PHP
    • AngularJS Examples
    • TypeScript Examples
    • React JS
    • Vue JS Examples
  • Native/Mobile SDKs
    • Flutter
  1. Native/Mobile SDKs

Flutter

A Flutter plugin for integrating Authyo – a powerful multi-channel MFA service supporting WhatsApp, SMS, Email, and Call for OTP verification.
This plugin enables developers to implement OTP-based authentication for both legacy systems and modern, passwordless solutions with minimal configuration.

Overview#

Authyo SDK accepts the user’s identity (phone number or email), authenticates through multiple channels, and returns a secure token upon success. The merchant app sends this token to its backend, which verifies it with the Authyo Server before proceeding with the user journey.
image.png

Integration Steps#

Step 1: Installation#

Add the following to your pubspec.yaml:
Then, run:
Please find the latest version of the SDK here

Step 2: Initialize the SDK#

1.
Import SDK in your Dart code:
2.
Then, create an instance of the SDK:
3.
Initialize AuthyoService using your Authyo credentials
📌
Important:
You must initialize AuthyoService with your clientId and clientSecret before making any requests.
4.
Usage
1
Send OTP
2
Verify OTP

API Reference#

Methods
init
sendOtp
to: (required) The destination address for the authentication message. The format depends on the selected authway:
For SMS or Voice: a valid phone number with country code (e.g., 15551234567)
For Email: a valid email address (e.g., user@example.com)
For WhatsApp: a valid phone number with country code linked to a WhatsApp account
otpLength: (optional) Specifies the number of digits in the generated One-Time Password (OTP).
Defaults to: the value defined in the application settings if not explicitly provided.
Example:
otplength: 6 generates a 6-digit OTP like 483921.
expiry: (optional) Time (in seconds) until the authentication code or message expires. Determines how long the code remains valid after being sent.
Defaults to: the value set in the application-level configuration if not provided.
Example:
expiry: 300 means the code is valid for 5 minutes.
authWay: (optional) Specifies the preferred authentication channel. Acceptable values include: "SMS", "Email", "WhatsApp", "VoiceCall" etc.
If not provided, the system will use the default method configured in the application settings.
onVerificationComplete: Optional callback function which provide if authentication is successful or not. Only required when plugin's default OTP verification dialog is being used.
verifyOtp
maskId: (required) Unique identifier returned by the sendotp API. It is used to reference the OTP session during verification in the verifyotp API.
otp: (required) The One-Time Password (OTP) entered by the user for verification. This value should match the OTP that was sent via the selected authway (e.g., SMS, Email, WhatsApp, Voice).

AuthyoResult#

A wrapper for API responses.
AuthyoBaseResponse
For sendOtp:
For verifyOtp:

Error Handling#

All errors are subclasses of AuthyoError.
To handle all the verification/initiation error codes for android and iOS, refer to the following code:
BadRequestError (400)
UnauthorizedError (401)
ForbiddenError (403)
NotFoundError (404)
TooManyRequestsError (429)
InternalServerError (500)
ServiceUnavailableError (503)
NetworkError
TimeoutError
UnknownApiError
Modified at 2025-08-22 13:54:52
Previous
Native/Mobile SDKs
Built with