Download the PHP package greatcode/otp-reader without Composer

On this page you can find all versions of the php package greatcode/otp-reader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package otp-reader

GreatCode OTP Reader & Google OAuth Manager

PHP Version PSR-12

An enterprise-grade, thread-safe, native PHP library designed for automated mail reading, OTP code extraction in web scraping, and atomic Google OAuth credential management.

Engineered specifically for high-concurrency production environments (PHP-FPM, Docker Replicas, Multi-Worker Scraping Pipelines) on shared Linux filesystems without requiring database dependencies.


๐ŸŒŸ Key Features


๐Ÿ—๏ธ Architecture Overview


๐Ÿ“ฆ Installation

Install via Composer:


๐Ÿš€ Quick Start Guide

1. Read OTP for Web Scraping Scripts (1-Line Initialization)


2. Custom Dynamic Body Parser Callable

If your email uses custom verification token formatting (e.g. [AUTH-992810]), pass a custom callable parser:


3. One-Line Web Account Registration UI (register.php)

Serve a self-contained, responsive Glassmorphism Web UI for registering accounts via browser in a single line of code:

Run local PHP server to test:

Open browser at http://localhost:8080 to access the registration UI.


๐Ÿ“– API Reference

Greatcode\OtpReader\Mail\MailReader

Method Description
createGmail($storageDir, $clientId, $clientSecret, $httpHandler = null) One-line static factory creating MailReader with Gmail Driver.
registerAccount($email, $refreshToken) Registers/updates an account's OAuth refresh token.
getLatestOtp($email, $from, $afterTime, $parser, $maxAttempts, $delaySeconds, $autoMarkAsRead) Polls, extracts OTP, retries with delay, and auto-marks message as read.
markAsRead($email, $messageId) Marks a specific email message as read in Gmail.
handleRegistration($storageDir, $clientId, $clientSecret) Static helper for handling web HTTP requests and rendering HTML UI.

๐Ÿ› ๏ธ Exception Hierarchy

All library exceptions extend from base exception classes:


๐Ÿงช Testing

Run full PHPUnit test suite:


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of otp-reader with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package greatcode/otp-reader contains the following files

Loading the files please wait ...