Search packages, repositories and app categories

Package detailsv2.0.0

twilio_phone_verify

A Package that helps in verifying phone numbers and email addresses using Twilio.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
61
Likes
29
Pub points
130

Install package

flutter pub add twilio_phone_verify

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The twilio_phone_verify package simplifies phone number and email verification in Flutter applications using Twilio's communication services. It enables developers to send verification codes via SMS or email, verify user input, and manage authentication flows securely. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform apps requiring robust identity verification. With straightforward integration, it streamlines the implementation of two-factor authentication and user onboarding workflows.

Use cases

  • User registration with phone/email verification
  • Two-factor authentication setup
  • Secure onboarding flows
  • Account recovery via verified contact
  • Cross-platform verification
  • Real-time code validation

Key features

  • Twilio-powered SMS and email verification
  • Support for multiple platforms
  • Simple API for sending and verifying codes
  • Built-in error handling
  • Cross-platform compatibility
  • Integration with existing authentication systems

Suitable for

  • Flutter apps needing secure user verification
  • Developers using Twilio for communications
  • Apps requiring two-factor authentication
  • Startups building user onboarding features
  • Teams developing multi-platform applications
  • Projects prioritizing rapid authentication implementation

Considerations

  • Requires a Twilio account and API credentials
  • May incur costs based on usage
  • Network connectivity required for verification
  • Limited customization compared to direct Twilio SDK
  • Dependent on Twilio service availability
  • Potential latency in SMS delivery

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Twilio_Phone_Verify

A Package that helps in verifying phone numbers and email addresses using Twilio.

Usage

To use this package :

  • add the dependency to your pubspec.yaml file.
dependencies:
  flutter:
    sdk: flutter
  twilio_phone_verify:
How to use
Create a new Object
TwilioPhoneVerify _twilioPhoneVerify; 
Initialize with values
_twilioPhoneVerify = new TwilioPhoneVerify(
        accountSid: '*************************', // replace with Account SID
        authToken: 'xxxxxxxxxxxxxxxxxx',  // replace with Auth Token
        serviceSid: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' // replace with Service SID
        );
Phone number verification
Send Code to Phone
 var twilioResponse =
        await _twilioPhoneVerify.sendSmsCode('phone');

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }
Verify Code
    var twilioResponse = await _twilioPhoneVerify.verifySmsCode(
        phone: 'phone', code: 'code');

    if (twilioResponse.successful) {
      if (twilioResponse.verification.status == VerificationStatus.approved) {
        //print('Phone number is approved');
      } else {
        //print('Invalid code');
      }
    } else {
      //print(twilioResponse.errorMessage);
    }
Email Verification

Twilio Verify email channel requires additional Service configuration. Please refer to the email channel setup documentation for detailed instructions.

Send Code to Email
 var twilioResponse =
        await _twilioPhoneVerify.sendEmailCode('email');

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }
Verify Email Code
    var twilioResponse = await _twilioPhoneVerify.verifyEmailCode(
        email: 'email', code: 'code');

    if (twilioResponse.successful) {
      if (twilioResponse.verification.status == VerificationStatus.approved) {
        //print('Email is approved');
      } else {
        //print('Invalid code');
      }
    } else {
      //print(twilioResponse.errorMessage);
    }
Override Email configurations
 var twilioResponse =
        await _twilioPhoneVerify.sendEmailCode('email',channelConfiguration:
    EmailChannelConfiguration(
        from: "override@example.com",
        from_name: "Override Name",
        template_id: "d-4f7abxxxxxxxxxxxx",
		usernameSubstitution: "Foo Bar"
    ));

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }

Features

  • [x] Phone verification
  • [x] Email verification.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.