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 1mo 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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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

1354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13ce4c415ae3440e4ed1b3301c243268bf1b69d25441b3ab8f0280df9306333f?d=identicon)[BitAnswer](/maintainers/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

[soup/paginator

Paginator is a simple class that allows you to create pagination. It doesn't require any database connection. It is compatible with Twitter's Bootstrap Framework, by using the CSS class pagination that is also attached.

351.5k](/packages/soup-paginator)[components/jquery-htmlclean

HTML Clean plug-in for jQuery

183.1k1](/packages/components-jquery-htmlclean)

PHPackages © 2026

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