PHPackages                             guanguans/yii-dingtalk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. guanguans/yii-dingtalk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

guanguans/yii-dingtalk
======================

Based on `mingyoung/dingtalk` developed a DingTalk expansion package adapted to Yii. - 基于 `mingyoung/dingtalk` 开发的适配于 Yii 的钉钉扩展包

v1.0.1(5y ago)258MITPHPPHP &gt;=5.6

Since Apr 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/guanguans/yii-dingtalk)[ Packagist](https://packagist.org/packages/guanguans/yii-dingtalk)[ Docs](https://github.com/guanguans/yii-dingtalk)[ Fund](https://www.guanguans.cn/images/wechat.jpeg)[ RSS](/packages/guanguans-yii-dingtalk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

yii-dingtalk
============

[](#yii-dingtalk)

> Based on [mingyoung/dingtalk](https://github.com/mingyoung/dingtalk) developed a DingTalk expansion package adapted to Yii. - 基于 [mingyoung/dingtalk](https://github.com/mingyoung/dingtalk) 开发的适配于 Yii 的钉钉扩展包。

[![Tests](https://github.com/guanguans/yii-dingtalk/workflows/Tests/badge.svg)](https://github.com/guanguans/yii-dingtalk/actions)[![Check & fix styling](https://github.com/guanguans/yii-dingtalk/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/yii-dingtalk/actions)[![codecov](https://camo.githubusercontent.com/70cd592cf3c4c1b7a1c25481338e8c4ce4e0249316097a41cfb773aa860406bd/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f7969692d64696e6774616c6b2f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d55524746415753365334)](https://codecov.io/gh/guanguans/yii-dingtalk)[![Latest Stable Version](https://camo.githubusercontent.com/697fbac6f801f4f59863ca25fd449f306321c2f6384125f3e1ae278b117e3bcf/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d64696e6774616c6b2f76)](//packagist.org/packages/guanguans/yii-dingtalk)[![Total Downloads](https://camo.githubusercontent.com/3230cac47a0b8a18c54e97d245e0c85ebfadff2980d4adeb11f8ae26dc7d2e35/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d64696e6774616c6b2f646f776e6c6f616473)](//packagist.org/packages/guanguans/yii-dingtalk)[![License](https://camo.githubusercontent.com/bc481f8870c86e98d70ddbe9b7f576efb546ba3f8fad89df41e064e43a8731f3/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d64696e6774616c6b2f6c6963656e7365)](//packagist.org/packages/guanguans/yii-dingtalk)

Requirement
-----------

[](#requirement)

- Yii &gt;= 2.0

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

[](#installation)

```
$ composer require guanguans/yii-dingtalk --prefer-dist -vvv
```

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

[](#configuration)

Add to the components of the Yii2 configuration file `config/main.php`:

```
'components' => [
    // ...
    'dingtalk' => [
        'class' => \Guanguans\YiiDingTalk\DingTalk::class,
        /*
         *【必填】企业 corpId
         */
        'corp_id' => 'dingd3ir8195906jfo93',
        /*
         *【必填】应用 AppKey
         */
        'app_key' => 'dingwu33fo1fjc0fszad',
        /*
         *【必填】应用 AppSecret
         */
        'app_secret' => 'RsuMFgEIY3jg5UMidkvwpzEobWjf9Fcu3ogzULm54WcV7j9fi3fJlUshk',
        /*
         *【选填】加解密
         * 此处的 `token` 和 `aes_key` 用于事件通知的加解密
         * 如果你用到事件回调功能，需要配置该两项
         */
        'token' => 'uhl3CZbtsmf93bFPanmMenhWwrqbSwPc',
        'aes_key' => 'qZEOmHU2qYYk6n6vqLfi3FAhcp9bGA2kgbfnsXDrGgN',
        /*
         *【选填】后台免登配置信息
         * 如果你用到应用管理后台免登功能，需要配置该项
         */
        'sso_secret' => 'Fx9_i5dSW5tpGtjalksdf98JF8uj32xb4NJQR5G9-VSchasd98asfdMmLR',
        /*
         *【选填】第三方网站 OAuth 授权
         * 如果你用到扫码登录、钉钉内免登和密码登录第三方网站，需要配置该项
         */
        'oauths' => [
            /*
            |-------------------------------------------
            | `app-01` 为你自定义的名称，不要重复即可
            |-------------------------------------------
            | 数组内需要配置 `client_id`, `client_secret`, `scope` 和 `redirect` 四项
            |
            | `client_id` 为钉钉登录应用的 `appId`
            | `client_secret` 为钉钉登录应用的 `appSecret`
            | `scope`:
            |     - 扫码登录第三方网站和密码登录第三方网站填写 `snsapi_login`
            |     - 钉钉内免登第三方网站填写 `snsapi_auth`
            | `redirect` 为回调地址
            */
            'app-01' => [
                'client_id' => 'dingoaxmia0afj234f7',
                'client_secret' => 'c4x4el0M6JqMC3VQP80-cFasdf98902jklFSUVdAOIfasdo98a2',
                'scope' => 'snsapi_login',
                'redirect' => 'https://easydingtalk.org/callback',
            ],
            /*
             * 可配置多个 OAuth 应用，数组内内容同上
             */
            'app-02' => [
                // ...
            ],
        ],
    ],
    // ...
],
```

Usage(Please refer to [mingyoung/dingtalk](https://github.com/mingyoung/dingtalk))
----------------------------------------------------------------------------------

[](#usageplease-refer-to-mingyoungdingtalk)

Get an instance:

```
// \EasyDingTalk\Application
Yii::$app->dingtalk->app;
Yii::$app->dingtalk->getApp();

// Override the options in the global configuration
Yii::$app->dingtalk->setOptions([
    'corp_id' => 'dingd3ir8195906jfo93',
    'app_key' => 'dingwu33fo1fjc0fszad',
    'app_secret' => 'RsuMFgEIY3jg5UMidkvwpzEobWjf9Fcu3oLqLyCUIgzULm54WcV7j9fi3fJlUshk',
])->app;

// \EasyDingTalk\Auth\SsoClient
Yii::$app->dingtalk->getSso();

// \EasyDingTalk\Auth\OAuthClient
Yii::$app->dingtalk->getOauth();

// \EasyDingTalk\User\Client
Yii::$app->dingtalk->getUser();

// \EasyDingTalk\Department\Client
Yii::$app->dingtalk->getDepartment();

// \EasyDingTalk\Process\Client
Yii::$app->dingtalk->getProcess();

// \EasyDingTalk\Role\Client
Yii::$app->dingtalk->getRole();

// \EasyDingTalk\Contact\Client
Yii::$app->dingtalk->getContact();

// \EasyDingTalk\Calendar\Client
Yii::$app->dingtalk->getCalendar();

// \EasyDingTalk\Attendance\Client
Yii::$app->dingtalk->getAttendance();

// \EasyDingTalk\Attendance\Client
Yii::$app->dingtalk->getCheckin();

// \EasyDingTalk\Report\Client
Yii::$app->dingtalk->getReport();

// \EasyDingTalk\Blackboard\Client
Yii::$app->dingtalk->getBlackboard();

// \EasyDingTalk\Microapp\Client
Yii::$app->dingtalk->getMicroapp();

// \EasyDingTalk\Health\Client
Yii::$app->dingtalk->getHealth();

// \EasyDingTalk\Health\Client
Yii::$app->dingtalk->getCallback();

// \EasyDingTalk\Kernel\Server
Yii::$app->dingtalk->getServer();
```

Testing
-------

[](#testing)

```
$ composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [guanguans](https://github.com/guanguans)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

1885d ago

### Community

Maintainers

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

---

Tags

dingtalkdingtalk-sdkyii2yii2-extensionyii2-frameworksdkyii2yiidingtalkdingtalk-sdk

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/guanguans-yii-dingtalk/health.svg)

```
[![Health](https://phpackages.com/badges/guanguans-yii-dingtalk/health.svg)](https://phpackages.com/packages/guanguans-yii-dingtalk)
```

###  Alternatives

[saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

1316.8k1](/packages/saviorlv-yii2-dysms)

PHPackages © 2026

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