kiremco/sdk

Official PHP SDK for Kirem WABA Dev Platform

Maintainers

Package info

github.com/Kiremco/php-sdk

pkg:composer/kiremco/sdk

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-08-17 12:26 UTC

This package is auto-updated.

Last update: 2026-08-17 12:32:13 UTC


README

Official PHP SDK for the Kirem WABA Dev Platform API.

Installation

Install the package via Composer:

composer require kiremco/sdk

Requirements

  • PHP >= 8.1
  • ext-json

Features

  • Guzzle-powered robust HTTP requests.
  • Custom ApiException for structured error handling.
  • Automatic unwrapping of Kirem standard response envelopes.
  • WhatsApp messages (Text, Image, Video, Document, Audio, Location, Contacts, Interactive, Template).
  • Media management (Upload, Get Metadata, Download, Delete).
  • Webhook settings management.
  • Message logs and Webhook analytics pull.
  • Omnichannel Connections & Social Content Publishing.
  • Model Context Protocol (MCP) tool invocation support.

Getting Started

Initialize the client and send a WhatsApp message:

<?php

require_once 'vendor/autoload.php';

use Kirem\Client as KiremClient;
use Kirem\ApiException;

$kirem = new KiremClient('your_kirem_api_key');

try {
    $result = $kirem->sendText('628123456789', 'Hello from Kirem PHP SDK! 🐘');
    echo "Message sent successfully!\n";
    print_r($result);
} catch (ApiException $e) {
    echo "Failed to send message (status {$e->getCode()}): {$e->getMessage()}\n";
    if ($e->getErrors()) {
        print_r($e->getErrors());
    }
}

Social Content Publishing (Omnichannel)

Publish social media posts across multiple connection IDs or social platforms (e.g., Facebook, Instagram, LinkedIn, WhatsApp) simultaneously:

<?php

require_once 'vendor/autoload.php';

use Kirem\Client as KiremClient;
use Kirem\ApiException;

$kirem = new KiremClient('your_kirem_api_key');

try {
    $response = $kirem->publishPost([
        'content'   => 'Check out our new launch! 🚀',
        'media_url' => 'https://example.com/banner.png',
        'platforms' => ['facebook', 'instagram', 'linkedin']
    ]);
    
    echo "Post queued successfully!\n";
    print_r($response);
} catch (ApiException $e) {
    echo "Publishing failed: {$e->getMessage()}\n";
}

Model Context Protocol (MCP)

PHP SDK includes a built-in helper to execute MCP commands via Kirem's SSE/HTTP POST endpoint:

<?php

require_once 'vendor/autoload.php';

use Kirem\Client as KiremClient;

$kirem = new KiremClient('your_kirem_api_key');

try {
    // Send a message using the MCP 'send_message' tool
    $response = $kirem->mcpSendMessage('628123456789', 'Hello from PHP MCP!');
    print_r($response);
} catch (Exception $e) {
    echo "MCP call failed: {$e->getMessage()}\n";
}

Documentation

For full details on payload formats and API responses, refer to the Kirem Official API Documentation.

License

MIT