๐Ÿงฉ Avlc SDK

avlcweb is a Flutter SDK that helps developers integrate authentication and OTP verification features into their apps using email or phone. It includes methods for logging in users, sending OTPs, verifying OTPs, and managing access/refresh tokens via SharedPreferences.


๐Ÿš€ Features

  • User Login with Email & Password
  • Send OTP to Email or Phone
  • Verify OTP
  • Access Token & Refresh Token Storage
  • Callback-based Initialization

๐Ÿ“ฆ Installation

Add the following to your pubspec.yaml:

dependencies:
  avlcweb: ^1.0.0

๐Ÿ› ๏ธ Usage

1. Import the SDK

import 'package:avlcweb/avlcweb.dart';

2. Initialize the SDK

final avlc = AvlcWeb(
  email: "[email protected]",
  password: "yourpassword",
  onInitialize: (isInitialized, {error}) {
    if (isInitialized) {
      print("SDK Initialized and User Logged In!");
    } else {
      print("Initialization failed: $error");
    }
  },
);

3. Send OTP

avlc.sendOtp({"email": "[email protected]"}, (response) {
  print("OTP Send Response: $response");
});

4. Verify OTP

avlc.verifyOtp({"email": "[email protected]", "otp": "123456"}, (response) {
  print("OTP Verify Response: $response");
});

๐Ÿงช Example

final avlcweb  = AvlcWeb();

avlcweb.initialize(
    email: "[email protected]",
    password: "securePassword123",
    onInitialize: (isInitialized, {error}) {
        if (isInitialized) {
        print("Welcome!");
        } else {
        print("Login error: $error");
        }
    },
);

๐Ÿ“š API Reference

Method Description
sendOtp() Sends OTP to email or phone number
verifyOtp() Verifies the OTP sent to email or phone number
getPlatformVersion() Returns the platform version (optional)

๐Ÿ“„ License

MIT License. See the LICENSE file for more details.

Libraries

avlcweb