PHPackages                             bhaskarvyas001/interakt-api-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. [API Development](/categories/api)
4. /
5. bhaskarvyas001/interakt-api-php

ActiveLibrary[API Development](/categories/api)

bhaskarvyas001/interakt-api-php
===============================

The easy way to integrate APIs for Interakt in PHP

v1.0.1(2w ago)04MITPHPPHP ^7.4 || ^8.0

Since May 23Pushed 2w agoCompare

[ Source](https://github.com/bhaskarvyas001/interakt-track-php)[ Packagist](https://packagist.org/packages/bhaskarvyas001/interakt-api-php)[ RSS](/packages/bhaskarvyas001-interakt-api-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Interakt APIs PHP
=================

[](#interakt-apis-php)

A PHP port of the Interakt api SDK with user and event tracking support.

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

[](#installation)

```
composer require bhaskarvyas001/interakt-api-php
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

use Interakt\Track\Track;

Track::$apiKey = 'YOUR_API_KEY';
Track::$syncMode = false; // default is async queue flushed on shutdown
Track::$debug = true;

Track::user(
    userId: 'user123',
    countryCode: '+91',
    phoneNumber: '9999999999',
    traits: ['name' => 'John Doe', 'email' => 'john@example.com']
);

Track::event(
    userId: 'user123',
    event: 'Order Placed',
    traits: ['orderValue' => '50.00'],
    countryCode: '+91',
    phoneNumber: '9999999999'
);

Track::flush();
```

API
---

[](#api)

- `Track::user($userId, $countryCode, $phoneNumber, $traits)`
- `Track::event($userId, $event, $traits, $countryCode, $phoneNumber)`
- `Track::flush()`
- `Track::join()`
- `Track::shutdown()`

Template Message (WhatsApp)
---------------------------

[](#template-message-whatsapp)

You can send WhatsApp template (HSM) messages using the SDK. The SDK provides a convenience method `Track::sendTemplate()` and a raw `Track::message()` call which posts to the `/v1/public/message/` endpoint.

Example using `sendTemplate`:

```
use Interakt\Track\Track;

Track::$apiKey = 'YOUR_API_KEY';

$template = [
    'name' => 'delivered_alert_101',
    'languageCode' => 'en',
    'bodyValues' => ['John', 'Order123'],
    // optional: 'headerValues' => ['Header text or media url'],
    // optional: 'buttonValues' => ['0' => ['payload0'], '1' => ['payload1']],
    // optional: 'fileName' => 'invoice.pdf' // when header is a document
];

// sends the template message (async by default)
Track::sendTemplate('+91', '9999999999', $template, 'optional-callback-data', null);
```

Example sending a raw payload with `Track::message`:

```
$body = [
    'countryCode' => '+91',
    'phoneNumber' => '9999999999',
    'type' => 'Template',
    'template' => $template,
    'callbackData' => 'some_callback_data',
];

Track::message($body);
```

The API responds with an `id` for the created message; delivery/read/failure status will be delivered later via webhooks.

Webhooks (message status and incoming messages)
-----------------------------------------------

[](#webhooks-message-status-and-incoming-messages)

Interakt sends webhooks for template delivery status (`message_api_sent`, `message_api_delivered`, `message_api_read`, `message_api_failed`) and for incoming messages (`message_received`). Webhooks are delivered to the URL configured in your Interakt developer settings.

Security: Interakt signs webhook payloads with HMAC SHA256 in the `Interakt-Signature` header (prefixed with `sha256=`). Use the SDK helper `Interakt\Track\Webhook::verify()` to validate the signature.

Example webhook verifier (PHP):

```
use Interakt\Track\Webhook;

$secret = 'YOUR_WEBHOOK_SECRET';
$payload = file_get_contents('php://input');
$headers = getallheaders();
$signature = $headers['Interakt-Signature'] ?? ($headers['interakt-signature'] ?? '');

if (!Webhook::verify($secret, $payload, $signature)) {
    http_response_code(401);
    echo 'invalid signature';
    exit;
}

$data = json_decode($payload, true);
// handle webhook types in $data['type'] and $data['data']

http_response_code(200);
```

Notes:

- Your webhook endpoint must be HTTPS and respond within 3 seconds.
- Any non-200 response or timeout is treated as a delivery failure by Interakt.
- The `callbackData` you passed when sending a template will be returned in the webhook payload so you can correlate messages.

Testing
-------

[](#testing)

```
vendor/bin/phpunit --configuration phpunit.xml.dist
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

17d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41efce14e3a6e4366bb1effa83d0af0fab4c5c289d8aa99e10f8438ad86ecdc4?d=identicon)[bhaskarvyas001](/maintainers/bhaskarvyas001)

---

Top Contributors

[![bhaskarvyas001](https://avatars.githubusercontent.com/u/11969704?v=4)](https://github.com/bhaskarvyas001 "bhaskarvyas001 (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bhaskarvyas001-interakt-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/bhaskarvyas001-interakt-api-php/health.svg)](https://phpackages.com/packages/bhaskarvyas001-interakt-api-php)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
