PHPackages                             kwri/kwapi-wrapper - 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. kwri/kwapi-wrapper

AbandonedArchivedLibrary[API Development](/categories/api)

kwri/kwapi-wrapper
==================

kwapi Client library

v1.1.0(9y ago)03.1k[1 PRs](https://github.com/KWRI/kwapi-wrapper/pulls)MITPHPPHP ^5.4|^7.0

Since Jul 5Pushed 8y ago4 watchersCompare

[ Source](https://github.com/KWRI/kwapi-wrapper)[ Packagist](https://packagist.org/packages/kwri/kwapi-wrapper)[ Docs](https://github.com/KWRI/kwapi-wrapper)[ RSS](/packages/kwri-kwapi-wrapper/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (3)Versions (11)Used By (0)

KWApi Client Library
====================

[](#kwapi-client-library)

This repository contains PHP and JS Library that allows you to access the KW-API Platform from your PHP app.

PHP Library
-----------

[](#php-library)

### Installation

[](#installation)

This library can be installed with Composer. Run this command:

```
composer require kwri/kwapi-wrapper

```

### Usage

[](#usage)

```
// Use old method (apiKey header)
$credential = new KWApi\Models\Credential("yourApiKey");
$credential->setEndPoint("http://kw-api.dev/v1/");
$service = new KWApi\KWApi($credential);

// Use new method (OpenID connect)

// Token data
$tokenType = 'bearer';
$accessToken = md5(time());
$refreshToken = md5(time()+1);
$expiresIn = 24*3600;

// User info  data
$kwUid = '999';
$email = 'pholenkadi17@gmail.com';
$company = 'Refactory';
$appName = 'KW-CRM';

$token = new KWAPI\Models\OpenIDToken($tokenType, $accessToken, $refreshToken, $expiresIn);
$userInfo = new KWAPI\Models\OpenIDUserInfo($kwUid, $email, $company, $appName);
$credential = new KWAPI\Models\OpenIDCredential($clientId, $token, $userInfo);
$credential->setEndPoint("http://kw-api.dev/v1/");
$service = new KWApi\KWApi($credential);

$response = $service->event()->browse();
```

### Test

[](#test)

1. Start KW-Api Service on local development
2. Copy `tests/config.php.dist` to `tests/config.php` and set your credential value
3. The test can be executed by running

```
./vendor/bin/phpunit --coverage-text

```

JS LIbrary
----------

[](#js-library)

### Installation

[](#installation-1)

To use the library, clone this repository to your local machine.

### Usage

[](#usage-1)

```
// Use old method (apiKey header)
const BasePath = 'Your/Path/lib/'

const Credential = require(BasePath + 'KWApi/Models/Credential')
const KWAPI = require(BasePath + 'KWApi/')

const credential = new Credential(apiKey)

// There are several services that can be used, please refer at Services dir
const ApiUser = new KWAPI(credential)

// Use new method (OPENID Connect)

// Token data
const tokenType = 'Bearer'
const accessToken = md5(new Date())
const refreshToken = md5(Math.floor(Date.now() / 1000) + 1)
const expiresIn = 24 * 3600

// setUpOpenID
const OpenIDToken = require(BasePath + 'KWApi/Models/OpenIDToken')
const OpenIDUserInfo = require(BasePath + 'KWApi/Models/OpenIDUserInfo')
const OpenIDCredential = require(BasePath + 'KWApi/Models/OpenIDCredential')
//  You can set the clientId as you type
const clientId = "98jjhury866"

const KWAPI = require(BasePath + 'KWApi/')

const token = new OpenIDToken(tokenType, accessToken, refreshToken, expiresIn)
const userInfo = new OpenIDUserInfo(kwUid, email, company, appName)
const credential = new OpenIDCredential(clientId, token, userInfo)

credential.setEndPoint(endPoint)

const KwApi = new KWAPI(credential)
```

### Test

[](#test-1)

1. Start KW-API Server on local development
2. The test can be executed by running `npm test` on your terminal

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~44 days

Recently: every ~56 days

Total

6

Last Release

3423d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2831721?v=4)[Josh Phipps](/maintainers/ogrethegreat)[@ogrethegreat](https://github.com/ogrethegreat)

---

Top Contributors

[![mgufrone](https://avatars.githubusercontent.com/u/1408044?v=4)](https://github.com/mgufrone "mgufrone (27 commits)")[![oleglfed](https://avatars.githubusercontent.com/u/6285131?v=4)](https://github.com/oleglfed "oleglfed (14 commits)")[![toopay](https://avatars.githubusercontent.com/u/534245?v=4)](https://github.com/toopay "toopay (8 commits)")[![rawaludin](https://avatars.githubusercontent.com/u/1274849?v=4)](https://github.com/rawaludin "rawaludin (3 commits)")[![izhur](https://avatars.githubusercontent.com/u/9399149?v=4)](https://github.com/izhur "izhur (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kwri-kwapi-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/kwri-kwapi-wrapper/health.svg)](https://phpackages.com/packages/kwri-kwapi-wrapper)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M948](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k36](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1933.1k4](/packages/aimeos-prisma)

PHPackages © 2026

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