PHPackages                             webhubworks/craft-weclapp-api - 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. webhubworks/craft-weclapp-api

ActiveCraft-plugin[API Development](/categories/api)

webhubworks/craft-weclapp-api
=============================

A Craft CMS wrapper around webhubworks/weclapp-api-core.

v1.0.1(1mo ago)063↓50%MITPHPPHP ^8.3

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/webhubworks/craft-weclapp-api)[ Packagist](https://packagist.org/packages/webhubworks/craft-weclapp-api)[ Docs](https://github.com/webhubworks/craft-weclapp-api)[ RSS](/packages/webhubworks-craft-weclapp-api/feed)WikiDiscussions main Synced 1w ago

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

Weclapp API for Craft CMS
=========================

[](#weclapp-api-for-craft-cms)

A Craft CMS wrapper around [`webhubworks/weclapp-api-core`](https://github.com/webhubworks/weclapp-api-core).

It is the Craft counterpart to `webhubworks/weclapp-api-laravel`: instead of a Laravel service provider + facade, it registers a **singleton Yii service** that exposes a fully configured core `Client`. The base URL and auth token are read from environment variables, so no per-call configuration is needed.

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

[](#requirements)

- Craft CMS 4.0+ or 5.0+
- PHP 8.3+

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

[](#installation)

```
composer require webhubworks/craft-weclapp-api
php craft plugin/install weclapp-api
```

Configuration
-------------

[](#configuration)

Set the two required environment variables in your `.env`:

```
WECLAPP_API_BASE_URL=https://your-tenant.weclapp.com/webapp/api/v2
WECLAPP_AUTH_TOKEN=your-auth-token

# Optional - request/response logging to storage/logs/weclapp-api.log (default: true)
WECLAPP_ENABLE_LOGGING=true
```

> Note: `WECLAPP_API_BASE_URL` should include the full API path (e.g. `/webapp/api/v2`). The adapter concatenates this base with the relative endpoint paths produced by the core client.

Usage
-----

[](#usage)

The plugin registers the core client behind a singleton `api` service:

```
use Webhub\WeclappApiCraft\Plugin;

// Shared, configured core client
$client = Plugin::getInstance()->getClient();

// equivalent to:
$client = Plugin::getInstance()->api->getClient();

$count = $client->getArticleCount();
$articles = $client->getArticle();
```

`getClient()` returns the generated `Webhubworks\WeclappApiCore\Client`, so every endpoint method from the core package is available.

How it works
------------

[](#how-it-works)

- `Plugin::config()` registers `WeclappService` as the `api` component. Craft instantiates Yii components once per request, giving singleton semantics.
- `WeclappService::getClient()` reads `WECLAPP_API_BASE_URL` and `WECLAPP_AUTH_TOKEN` via `craft\helpers\App::env()`, then builds the core client with the `CraftHttpClient` PSR-18 adapter, caching the result.
- `CraftHttpClient` implements `Psr\Http\Client\ClientInterface` on top of `Craft::createGuzzleClient()`. It prepends the base URL to each relative endpoint URI and attaches the `AuthenticationToken` header - the same contract the Laravel wrapper fulfils with Laravel's HTTP client.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53560154?v=4)[webhub](/maintainers/webhubworks)[@webhubworks](https://github.com/webhubworks)

![](https://www.gravatar.com/avatar/2c4c102b81ef27c8c29f2a30fff2a9c86619d4c05f9128c5aa97bb94c991709a?d=identicon)[marventhieme](/maintainers/marventhieme)

---

Top Contributors

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

---

Tags

cmsCraftcraftcmscraft-pluginweclappcraft-weclapp-api

### Embed Badge

![Health badge](/badges/webhubworks-craft-weclapp-api/health.svg)

```
[![Health](https://phpackages.com/badges/webhubworks-craft-weclapp-api/health.svg)](https://phpackages.com/packages/webhubworks-craft-weclapp-api)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101393.6k74](/packages/verbb-formie)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36208.3k3](/packages/wrav-oembed)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)[craftpulse/craft-typesense

Craft Plugin that synchronises with Typesense

122.7k](/packages/craftpulse-craft-typesense)

PHPackages © 2026

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