PHPackages                             bkpsdm-karawang/sim-asn-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. bkpsdm-karawang/sim-asn-php-client

ActiveLibrary[API Development](/categories/api)

bkpsdm-karawang/sim-asn-php-client
==================================

PHP Client for SIM-ASN Service BKPSDM Karawang

5.1.0(1mo ago)0890[1 issues](https://github.com/bkpsdm-karawang/sim-asn-php-client/issues)MITPHPPHP ^8.3

Since Oct 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/bkpsdm-karawang/sim-asn-php-client)[ Packagist](https://packagist.org/packages/bkpsdm-karawang/sim-asn-php-client)[ Docs](https://sim-asn.bkpsdm.karawangkab.go.id)[ RSS](/packages/bkpsdm-karawang-sim-asn-php-client/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (18)Versions (43)Used By (0)

SIM-ASN PHP Client
==================

[](#sim-asn-php-client)

This is php client SDK for SIM-ASN BKPSDM Kabupaten Karawang api services

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

[](#installation)

require this package via composer

```
composer require bkpsdm-karawang/sim-asn-php-client

```

add environment value to `.env`

```
SIM_ASN_CLIENT_ID=xxxx
SIM_ASN_CLIENT_SECRET=xxxx
```

We recomend add two field to user table

```
    $table->uuid('sim_asn_user_id')->nullable()->default(null);
    $table->json('sim_asn_token')->nullable()->default(null);
```

Add refresh token handler in boot of `AppServiceProvider.php`

```
    use SIM_ASN\Laravel\Facades\UserClient;
    use SIM_ASN\Models\AccessToken;
    ...
    /**
     * Register any application services.
     *
     * @return void
     */
    public function boot(Request $request)
    {
        $user = $request->user();

        if ($user) {
            if ($user->sim_asn_token) {
                UserClient::setAccessToken($user->sim_asn_token);
            }

            UserClient::onRefreshToken(function(AccessToken $accessToken) use ($user) {
                $user->sim_asn_token = $accessToken;
                $user->save();
            });
        }
    }
```

Usage
-----

[](#usage)

Create callback handler route

```
    use SIM_ASN\Laravel\Facades\OauthClient;
    use SIM_ASN\Models\AccessToken;
    use SIM_ASN\Models\User as UserSimASN;

    /**
     * callback sim-asn
     */
    public function callbackSimASN(Request $request)
    {
        return OauthClient::handleCallback($request, function (UserSimASN $userSimASN, AccessToken $token) {
            $user = User::whereSimAsnUserId($userSimASN->id)->first();

            if ($user) {
                $user->sim_asn_token = $token;
                $user->save();
                return Auth::login($user);
            }

            return null;
        });
    }
```

Manualy get access token by response code

```
$accessToken = OauthClient::requestAccessToken($request->code);
```

Get user profile

```
$user = UserClient::setAccessToken($accessToken)->getUser();
```

App Client or User Client is extended class from guzzle client so you can directly use http guzzle client

```
use SIM_ASN\Laravel\Facades\AppClient;
...
AppClient::get('/api/endpoint');
AppClient::post('/api/endpoint', [
    'body' => ['foo' => 'bar']
]);
```

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 50.9% 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 ~40 days

Recently: every ~90 days

Total

42

Last Release

33d ago

Major Versions

1.1.6 → 2.0.02023-02-25

1.1.7 → 2.1.02023-08-25

2.1.4 → 3.0.02024-05-25

3.1.4 → 4.0.02025-05-05

4.1.1 → 5.0.02026-05-11

PHP version history (4 changes)1.0.0PHP ^7.3

2.0.0PHP ^8.1

3.0.0PHP ^8.2

4.0.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![denmasyarikin](https://avatars.githubusercontent.com/u/18554343?v=4)](https://github.com/denmasyarikin "denmasyarikin (27 commits)")[![dedenmaulana](https://avatars.githubusercontent.com/u/4162864?v=4)](https://github.com/dedenmaulana "dedenmaulana (26 commits)")

---

Tags

sim asnbkpsdmkarawang

### Embed Badge

![Health badge](/badges/bkpsdm-karawang-sim-asn-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/bkpsdm-karawang-sim-asn-php-client/health.svg)](https://phpackages.com/packages/bkpsdm-karawang-sim-asn-php-client)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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