PHPackages                             metolabs/otpauth-migration-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. metolabs/otpauth-migration-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

metolabs/otpauth-migration-php
==============================

Google Authenticator migration decoder

1.0.1(9mo ago)013MITPHPPHP ^8.0

Since Jun 20Pushed 9mo agoCompare

[ Source](https://github.com/MetoLabs/otpauth-migration-php)[ Packagist](https://packagist.org/packages/metolabs/otpauth-migration-php)[ RSS](/packages/metolabs-otpauth-migration-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

MetoLabs\\OtpAuthMigration
==========================

[](#metolabsotpauthmigration)

A simple PHP wrapper for the `dim13/otpauth` [CLI tool](https://github.com/dim13/otpauth) to decode Google Authenticator migration URLs (`otpauth-migration://`) into usable TOTP secrets.

This package runs the `otpauth` CLI binary under the hood via [Symfony Process](https://symfony.com/doc/current/components/process.html) and parses its output.

---

Features
--------

[](#features)

- Validate and locate the `otpauth` binary automatically or accept a custom path
- Decode migration URLs (`otpauth-migration://offline?data=...`)
- Return detailed TOTP secrets including issuer, account, secret, algorithm, digits, and period

---

Requirements
------------

[](#requirements)

- PHP 8.0+
- `dim13/otpauth` CLI binary installed and accessible in your system `PATH`
- Composer dependencies installed (`symfony/process`)

---

Installation
------------

[](#installation)

1. Install the `dim13/otpauth` CLI tool (requires Go):

```
go install github.com/dim13/otpauth@latest
```

Alternatively, you can download a prebuilt binary from the [releases](https://github.com/dim13/otpauth/releases/latest) page.

Make sure `otpauth` is in your `PATH` when using installer.

2. Install the package via Composer:

```
composer require metolabs\otpauth-migration-php
```

3. Add the `OtpAuthMigration` class to your project or include via your autoloader.

---

Usage
-----

[](#usage)

```
