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

1355d 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

[thenextweb/passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

297435.6k](/packages/thenextweb-passgenerator)[theseer/autoload

A tool and library to generate autoload code.

393193.5k7](/packages/theseer-autoload)[ramytalal/label-printer

An implementation of the Brother label printer API.

6641.8k](/packages/ramytalal-label-printer)[gillesgoetsch/acf-smart-button

A simple, clean and lean ACF Field for internal and external links.

7625.5k](/packages/gillesgoetsch-acf-smart-button)

PHPackages © 2026

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