PHPackages                             bitanswer/php-sdk - 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. bitanswer/php-sdk

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

bitanswer/php-sdk
=================

bitanswer sdk

1.0.6(3y ago)318MITPHP

Since Apr 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/BitAnswer/php-sdk)[ Packagist](https://packagist.org/packages/bitanswer/php-sdk)[ RSS](/packages/bitanswer-php-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (7)DependenciesVersions (8)Used By (0)

php-sdk
=======

[](#php-sdk)

安装
==

[](#安装)

使用 composer 进行安装。

```
composer require bitanswer/php-sdk
```

认证接口
====

[](#认证接口)

```
use Bit\Auth\Authentication;

$authentication = new Authentication(
    $app_id, // 用来唯一标识App
    $app_secret, // app密码
    $app_host, // 用户池域名
    $protocol, // 认证协议，目前仅支持oidc
    $redirect_uri = null); // 回调地址

// 获取登录地址
$authentication->getAuthorizeUrl();
// 获取accessToken
$authentication->getAccessTokenByCode($code);
// 获取登出地址
$authentication->getLogoutUrl();
```

上述参数，在注册为 [bitanswer](https://account.bitanswer.cn/?app=bit) 用户后，均可以得到。

错误处理
====

[](#错误处理)

通过try catch 捕获错误。

```
try {
    $authentication = new Authentication(...);
    $authentication->getAuthorizeUrl();
} catch (\Exception $e) {
    print_r($e);
}
```

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% 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 ~22 days

Recently: every ~29 days

Total

7

Last Release

1447d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/103987499?v=4)[Bitanswer](/maintainers/BitAnswer)[@Bitanswer](https://github.com/Bitanswer)

---

Top Contributors

[![Luoao](https://avatars.githubusercontent.com/u/18459571?v=4)](https://github.com/Luoao "Luoao (15 commits)")[![luohao-me](https://avatars.githubusercontent.com/u/167944182?v=4)](https://github.com/luohao-me "luohao-me (2 commits)")

### Embed Badge

![Health badge](/badges/bitanswer-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/bitanswer-php-sdk/health.svg)](https://phpackages.com/packages/bitanswer-php-sdk)
```

###  Alternatives

[clue/graph-composer

Dependency graph visualization for composer.json

93999.5k12](/packages/clue-graph-composer)[murilo-perosa/domain-tools

Handle domains and DNS tools.

122.8k](/packages/murilo-perosa-domain-tools)

PHPackages © 2026

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