Download the PHP package kirimi/kirimi-php without Composer
On this page you can find all versions of the php package kirimi/kirimi-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kirimi/kirimi-php
More information about kirimi/kirimi-php
Files in kirimi/kirimi-php
Package kirimi-php
Short Description Official PHP client library for the Kirimi WhatsApp API. Send messages, handle OTP verification, and manage WhatsApp communication with ease.
License MIT
Homepage https://github.com/yolkmonday/kirimi-php
Informations about the package kirimi-php
Kirimi PHP Client
Official PHP client library for the Kirimi WhatsApp API. This library provides a simple and efficient way to send WhatsApp messages, handle OTP generation and validation, and manage WhatsApp communication from your PHP applications.
๐ Features
- โ Send WhatsApp messages (text and media)
- โ Generate and validate OTP codes
- โ Support for multiple package types (Free, Lite, Basic, Pro)
- โ PSR-4 autoloading support
- โ Comprehensive error handling
- โ Type hints and modern PHP features
- โ Health check monitoring
- โ Service classes for common use cases
๐ฆ Installation
Install via Composer:
๐ง Requirements
- PHP 7.4 or higher
- Guzzle HTTP client (installed automatically)
- ext-json (usually included in PHP)
๐ง Setup
Get your User Code and Secret Key from the Kirimi Dashboard.
๐ API Reference
Constructor
Parameters:
$userCode
(string): Your unique user code from Kirimi Dashboard$secret
(string): Your secret key for authentication$endpoint
(string): API endpoint URL (optional)
Send Message
Send WhatsApp messages with optional media support.
Parameters:
$deviceId
(string): Your device ID$receiver
(string): Recipient's phone number (with country code)$message
(string): Message content (max 1200 characters)$mediaUrl
(string|null): URL of media file to send (optional)
Package Support:
- Free: Text only (with watermark)
- Lite/Basic/Pro: Text + Media support
Generate OTP
Generate and send a 6-digit OTP code to a WhatsApp number.
Parameters:
$deviceId
(string): Your device ID$phone
(string): Phone number to receive OTP
Requirements:
- Package must be Basic or Pro
- Device must be connected and not expired
Validate OTP
Validate a previously sent OTP code.
Parameters:
$deviceId
(string): Your device ID$phone
(string): Phone number that received the OTP$otp
(string): 6-digit OTP code to validate
Notes:
- OTP expires after 5 minutes
- Each OTP can only be used once
Health Check
Check the API service status.
๐ฏ Quick Start
Check out the examples/demo.php
file for a complete demonstration of all features:
๐ก Usage Examples
Basic WhatsApp Messaging
OTP Verification Flow
Notification Service
Laravel Integration
๐ Package Types & Features
Package | ID | Features | OTP Support |
---|---|---|---|
Free | 1 | Text only (with watermark) | โ |
Lite | 2, 6, 9 | Text + Media | โ |
Basic | 3, 7, 10 | Text + Media + OTP | โ |
Pro | 4, 8, 11 | Text + Media + OTP | โ |
โ ๏ธ Error Handling
The library provides comprehensive error handling using KirimiException
:
๐ Security Notes
- Always keep your secret key secure and never expose it in client-side code
- Use environment variables to store credentials
- Validate phone numbers before sending messages
- Implement rate limiting in your application
๐ฆ Rate Limits & Quotas
- Each message sent reduces your device quota (unless unlimited)
- OTP codes expire after 5 minutes
- Device must be in 'connected' status to send messages
- Check your dashboard for current quota and usage statistics
๐งช Testing
Run the test suite:
Run tests with coverage:
Check code style:
Fix code style:
๐ค Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
- Follow PSR-12 coding standards
- Add tests for new features
- Submit a pull request
๐ License
๐จโ๐ป Author
Ari Padrian - [email protected]
๐ Additional Resources
Made with โค๏ธ for the PHP and WhatsApp automation community