Download the PHP package eaglebirth/eaglebirth-php without Composer
On this page you can find all versions of the php package eaglebirth/eaglebirth-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eaglebirth/eaglebirth-php
More information about eaglebirth/eaglebirth-php
Files in eaglebirth/eaglebirth-php
Package eaglebirth-php
Short Description Official PHP SDK for EagleBirth API - Email, SMS, WhatsApp, OTP, QR Codes, and Vision AI
License MIT
Homepage https://eaglebirth.com
Informations about the package eaglebirth-php
EagleBirth PHP SDK
Official PHP SDK for the EagleBirth API.
Installation
Install via Composer:
Requirements
- PHP 7.4 or higher
- cURL extension
- JSON extension
Quick Start
Authentication
Get your API key from https://eaglebirth.com > Dashboard > Apps > API Keys
Environments
The SDK automatically routes requests to the correct environment based on your API key prefix:
- Sandbox/Test (
eb_test_...) - Routes tosandbox.eaglebirth.com. For development and testing. No charges, uses test data. - Production (
eb_live_...) - Routes toeaglebirth.com. For live applications. Real charges apply.
No additional configuration needed - just use the appropriate API key and the SDK will automatically connect to the right server. You can create separate API keys for each environment from your dashboard.
Usage Examples
SMS
OTP (One-Time Passwords)
QR Code Generation
Vision AI
Cloud Storage
User Management
Manage your application's end users. All operations use your API key (no additional authentication needed).
php // Create a new user $user = $client->users->create( email: '[email protected]', username: 'johndoe', firstName: 'John', lastName: 'Doe', password: 'securepassword123', phone: '+1234567890' ); echo "User created with ID: {$user['data']['user_id']}\n";
// Check if a user exists $exists = $client->users->exists(username: 'johndoe'); if ($exists['data']['exists']) { echo "User exists!\n"; }
// Get user details $userDetails = $client->users->get(username: 'johndoe'); echo "User email: {$userDetails['data']['email']}\n";
// List all users (paginated) $users = $client->users->listAll(page: 1, limit: 10); foreach ($users['data']['users'] as $user) { echo "{$user['username']} - {$user['email']}\n"; }
// Update user details $client->users->update( username: 'johndoe', email: '[email protected]', firstName: 'Jonathan' );
// Sign in a user (classic username/password) $signinResult = $client->users->signIn( username: 'johndoe', password: 'securepassword123' ); $accessToken = $signinResult['data']['access']; $refreshToken = $signinResult['data']['refresh'];
// Sign in with third-party auth (e.g., Google, Facebook) $signinResult = $client->users->signIn( authenticationType: 'google', authenticationTypeId: 'google_user_id_12345' );
// OAuth PKCE Flow with EagleBirth Auth UI // After user authenticates via EagleBirth Auth UI, you'll receive a 'code' // Exchange the code for user session and data $userSession = $client->users->exchangeCodeForUser( code: 'authorization_code_from_redirect', codeVerifier: 'your_code_verifier' ); echo "User email: {$userSession['data']['email']}\n"; echo "Access token: {$userSession['data']['access']}\n"; echo "User ID: {$userSession['data']['user_id']}\n";
// Verify if a session token is valid $isValid = $client->users->verifyToken(token: $accessToken);
// Refresh user session token $newTokens = $client->users->refreshToken(refresh: $refreshToken);
// Update user password (admin action) $client->users->updatePassword( username: 'johndoe', password: 'newpassword456' );
// Send verification code for password reset $codeResponse = $client->users->sendVerificationCode(username: 'johndoe'); $codeId = $codeResponse['data']['code_id'];
// Validate the verification code $client->users->validateVerificationCode( code: '123456', codeId: $codeId );
// Reset password using verification code (self-service) $client->users->resetPassword( code: '123456', codeId: $codeId, password: 'brandnewpassword789' );
// Update user status $client->users->updateStatus( username: 'johndoe', status: 'suspended' // Options: 'active', 'suspended', 'pending', 'deleted' );
// Update user type/role $client->users->updateType( username: 'johndoe', type: 'premium' );
// Reactivate a suspended user $client->users->reactivate(username: 'johndoe');
// Sign out a user (invalidate refresh token) $client->users->signOut(refreshToken: $refreshToken);
// Delete a user $client->users->delete(username: 'johndoe'); json { "event": "message.reply.sms", "test": false, "data": { "from": "+1234567890", "to": "+0987654321", "body": "Thanks!", "channel": "sms", "sub_channel": "direct", "message_id": "SM_abc123", "original_message_id": "eb_msg_xyz", "timestamp": "2024-01-15T10:30:00Z" } }
## Error Handling
## Configuration
### Cloud Storage
### Authentication
## Available Resources
- `$client->email` - Email notifications
- `$client->sms` - SMS messaging
- `$client->whatsapp` - WhatsApp messaging
- `$client->otp` - OTP/verification codes
- `$client->qr` - QR code generation
- `$client->vision` - Vision AI (face detection, OCR, face comparison)
- `$client->storage` - Cloud storage (files and directories)
- `$client->storage->file` - File operations
- `$client->storage->directory` - Directory operations
- `$client->users` - User management for your app's end users
- `$client->webhooks` - Messaging webhook management (register, list, test, pause, delete)
## Support
- Documentation: [https://eaglebirth.com/developer/documentation](https://eaglebirth.com/developer/documentation)
- Email: [email protected]
- Dashboard: [https://eaglebirth.com](https://eaglebirth.com)
## License
MIT LicenseAll versions of eaglebirth-php with dependencies
ext-curl Version *
ext-json Version *