PHPackages                             dairin-kaeru/dairin-php-client - 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. dairin-kaeru/dairin-php-client

ActiveLibrary[API Development](/categories/api)

dairin-kaeru/dairin-php-client
==============================

DairinのAPIを呼び出すためのPHPクライアントライブラリ

077PHP

Since Oct 10Pushed 7mo ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

dairin-php-client
=================

[](#dairin-php-client)

Dairin のプロジェクト操作用 API を呼び出すための PHP クライアントライブラリです。

広告主様のシステムに組み込んでご使用いただけます。

Dairin の API を PHP 以外の実行環境でご利用いただきたい場合は、本リポジトリの実装を参考にご自身の環境向けに移植してください。

インストール
------

[](#インストール)

Composerを利用してインストールします。

```
composer require dairin-kaeru/dairin-php-client
```

#### Packagist のリンク

[](#packagist-のリンク)

使用例
---

[](#使用例)

```
require 'vendor/autoload.php';
use DairinClient\DairinClient;
use GuzzleHttp\Exception\BadResponseException;

$key = getenv('DAIRIN_PROJECT_API_KEY');
$secret = getenv('DAIRIN_PROJECT_API_SECRET');
$client = new DairinClient($key, $secret);
$jsonEncodeFlags = JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES;

// 疎通確認
try {
    $pingResp = $client->ping();
    echo json_encode(json_decode($pingResp->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
} catch (BadResponseException $e) {
    echo json_encode(json_decode($e->getResponse()->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
    exit(1);
}

$partner_code = '';
$campaign_code = '';
$customer_uid = date('Y/m/d_H:i:s.v');

// 新規の顧客に中間CVを発生させる
try {
    $signupResp = $client->signup(
        partner_code: $partner_code,
        campaign_code: $campaign_code,
        customer_uid: $customer_uid,
    );
    echo json_encode(json_decode($signupResp->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
} catch (BadResponseException $e) {
    echo json_encode(json_decode($e->getResponse()->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
    exit(2);
}

// 既存の顧客（中間CVユーザー）に最終CVを発生させる
try {
    $completeResp = $client->complete(
        customer_uid: $customer_uid,
        campaign_code: $campaign_code,
        event_id: 'dairin-php-client から発火しました',
        //sales_amount: 1000,
    );
    echo json_encode(json_decode($completeResp->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
} catch (BadResponseException $e) {
    echo json_encode(json_decode($e->getResponse()->getBody()), $jsonEncodeFlags);
    echo PHP_EOL;
    exit(3);
}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance45

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb9ca1c539d222ba34988474712eb4169c959cc4e090e7fbae3a632fa344e223?d=identicon)[dairin](/maintainers/dairin)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dairin-kaeru-dairin-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/dairin-kaeru-dairin-php-client/health.svg)](https://phpackages.com/packages/dairin-kaeru-dairin-php-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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