Understand the Flow
Learn how the authentication protocol works under the hood. Authentication Flow →
Get passwordless authentication working in your application in just a few minutes.
Before you begin, make sure you have:
composer require bytefederal/byteauth-laravelphp artisan vendor:publish --tag=byteauth-configAdd to your .env file:
BYTEAUTH_DOMAIN_REGISTERED=yourdomain.comBYTEAUTH_API_KEY=your_api_key_hereIn routes/web.php:
use ByteFederal\ByteAuthLaravel\Controllers\WebhookController;
Route::post('/webhook/registration', [WebhookController::class, 'handleRegistration']);Route::post('/webhook/login', [WebhookController::class, 'handleLogin']);Route::get('/api/check', [WebhookController::class, 'check']);In your Blade template:
<livewire:byteauth-qr-login />npm install @bytefederal/byteauth-nextjs# oryarn add @bytefederal/byteauth-nextjsCreate or update .env.local:
BYTEAUTH_DOMAIN=yourdomain.comBYTEAUTH_API_KEY=your_api_key_hereBYTEAUTH_WEBHOOK_SECRET=your_webhook_secretCreate app/api/byteauth/[...byteauth]/route.ts:
import { ByteAuthHandler } from '@bytefederal/byteauth-nextjs';
export const { GET, POST } = ByteAuthHandler({ callbacks: { async onLogin(user) { // Handle successful login console.log('User logged in:', user.publicKey); }, async onRegister(user) { // Handle new registration console.log('New user registered:', user.publicKey); }, },});import { ByteAuthQR } from '@bytefederal/byteauth-nextjs/client';
export default function LoginPage() { return ( <div> <h1>Login</h1> <ByteAuthQR onSuccess={(user) => { // Redirect to dashboard window.location.href = '/dashboard'; }} /> </div> );}Start your development server
Run your application locally.
Open the login page
Navigate to your login page where the QR code is displayed.
Open ByteVault
Launch the ByteVault app on your phone.
Scan the QR code
Tap the scan button and point at the QR code.
Authenticate
Confirm with Face ID, Touch ID, or your device passcode.
Done!
You should be logged into your application.
Understand the Flow
Learn how the authentication protocol works under the hood. Authentication Flow →
Configure Webhooks
Set up webhook handlers for registration and login events. Webhook Guide →
Customize Components
Style the QR component to match your application’s design. Customization →
API Reference
Explore the complete API documentation. API Docs →