PHPackages                             keyqcloud/kyte-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. keyqcloud/kyte-api-php

ActiveLibrary[API Development](/categories/api)

keyqcloud/kyte-api-php
======================

SDK for communicating with a Kyte API endpoint.

v1.0.1(5mo ago)016MITPHPPHP &gt;=7.2

Since Apr 9Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/keyqcloud/kyte-api-php)[ Packagist](https://packagist.org/packages/keyqcloud/kyte-api-php)[ RSS](/packages/keyqcloud-kyte-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Kyte API PHP Client
===================

[](#kyte-api-php-client)

The Kyte API PHP Client is a comprehensive and easy-to-use PHP client for interacting with the Kyte API. It encapsulates all the necessary methods for making HTTP requests to the Kyte API, including authentication, session management, and standard CRUD operations.

**Updated to match Kyte.JS v1.2.23**

Features
--------

[](#features)

- ✅ Supports all basic CRUD operations (Create, Read, Update, Delete)
- ✅ Client-side HMAC-SHA256 signature generation
- ✅ Automatic session token management
- ✅ API key handoff support (multi-tenant applications)
- ✅ Application ID support (x-kyte-appid header)
- ✅ Comprehensive error handling
- ✅ Easy to integrate and use in any PHP-based application

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- cURL extension enabled

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

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require keyqcloud/kyte-api-php
```

### Manual Installation

[](#manual-installation)

Include the `Client.php` file in your project:

```
require_once 'path/to/src/Api/Client.php';
```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

Initialize the client with your Kyte API credentials:

```
use Kyte\Api\Client;

$publicKey = 'your-public-key';
$privateKey = 'your-private-key';
$account = 'your-account-number';
$identifier = 'your-api-identifier';
$endpoint = 'https://your-api-endpoint.com/api';
$appId = 'your-app-id'; // Optional

$client = new Client($publicKey, $privateKey, $account, $identifier, $endpoint, $appId);
```

### Authentication

[](#authentication)

#### Create a Session (Login)

[](#create-a-session-login)

```
try {
    $response = $client->createSession('user@example.com', 'password');

    if (isset($response['data'])) {
        echo "Logged in as: " . $response['data'][0]['email'];
        echo "Session token: " . $client->getSessionToken();
    }
} catch (Exception $e) {
    echo 'Login failed: ' . $e->getMessage();
}
```

#### Destroy Session (Logout)

[](#destroy-session-logout)

```
$client->destroySession();
echo "Logged out successfully";
```

### CRUD Operations

[](#crud-operations)

#### GET Request - Fetch Single Record

[](#get-request---fetch-single-record)

```
try {
    // GET /api/User/email/john@example.com
    $response = $client->get('User', 'email', 'john@example.com');

    if (isset($response['data']) && !empty($response['data'])) {
        $user = $response['data'][0];
        echo "Found user: " . $user['name'];
    }
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

#### GET Request - Fetch All Records

[](#get-request---fetch-all-records)

```
try {
    // GET /api/User
    $response = $client->get('User');

    foreach ($response['data'] as $user) {
        echo $user['name'] . "\n";
    }
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

#### POST Request - Create Record

[](#post-request---create-record)

```
try {
    $data = [
        'name' => 'John',
        'last_name' => 'Doe',
        'email' => 'john.doe@example.com'
    ];

    // POST /api/User
    $response = $client->post('User', $data);

    echo "Created user with ID: " . $response['data'][0]['id'];
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

#### PUT Request - Update Record

[](#put-request---update-record)

```
try {
    $data = [
        'name' => 'John Updated',
        'last_name' => 'Doe'
    ];

    // PUT /api/User/id/123
    $response = $client->put('User', 'id', '123', $data);

    echo "User updated successfully";
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

#### DELETE Request - Delete Record

[](#delete-request---delete-record)

```
try {
    // DELETE /api/User/id/123
    $response = $client->delete('User', 'id', '123');

    echo "User deleted successfully";
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Advanced Features
-----------------

[](#advanced-features)

### Custom Headers

[](#custom-headers)

You can pass custom headers to any request:

```
$headers = ['X-Custom-Header: value'];
$response = $client->get('User', 'id', '123', $headers);
```

### Session Token Management

[](#session-token-management)

Get and set session tokens for session persistence:

```
// Get current session token
$sessionToken = $client->getSessionToken();

// Restore session token (e.g., from cookie)
$client->setSessionToken($savedSessionToken);
$client->setTransactionToken($savedTxToken);
```

### API Key Handoff (Multi-Tenant)

[](#api-key-handoff-multi-tenant)

The client automatically handles API key handoff for multi-tenant applications. When the API returns `kyte_pub`, `kyte_iden`, and `kyte_num` in the response, the client automatically switches to those credentials for subsequent requests.

Error Handling
--------------

[](#error-handling)

The client throws exceptions for all errors. Always wrap API calls in try-catch blocks:

```
try {
    $response = $client->get('User', 'email', 'test@example.com');
    // Process response
} catch (Exception $e) {
    // Handle error
    error_log("API Error: " . $e->getMessage());
    // Show user-friendly message
    echo "An error occurred. Please try again.";
}
```

Support
-------

[](#support)

For support and feature requests, please send an email to .

Contributing
------------

[](#contributing)

We welcome contributions to this client. Please send your pull requests to the repository.

License
-------

[](#license)

This client is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance70

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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 ~595 days

Total

2

Last Release

174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59730092414d1c68ddaf657c1b7958ce5c46e4ffcc123663051b5b4584cb5a6c?d=identicon)[kennethphough](/maintainers/kennethphough)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/keyqcloud-kyte-api-php/health.svg)

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

###  Alternatives

[sociallydev/spaces-api

Library for accessing Digital Ocean spaces

218428.6k](/packages/sociallydev-spaces-api)[thephalcons/amazon-webservices-bundle

A Symfony2 Bundle for interfacing with Amazon Web Services (AWS)

110224.7k](/packages/thephalcons-amazon-webservices-bundle)[keboola/storage-api-client

Keboola Storage API PHP Client

10387.5k25](/packages/keboola-storage-api-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[cion/laravel-text-to-speech

This package creates a shared API to easily use Text to Speech functionalities amongst different TTS providers.

4228.3k](/packages/cion-laravel-text-to-speech)[larareko/aws-rekognition

A Laravel package for the AWS Rekognition

2013.1k](/packages/larareko-aws-rekognition)

PHPackages © 2026

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