PHPackages                             ashvia/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. [API Development](/categories/api)
4. /
5. ashvia/sdk

ActiveLibrary[API Development](/categories/api)

ashvia/sdk
==========

Official PHP SDK for the ASHVIA Ecosystem.

v1.0.2(2d ago)01↓100%MITPHPPHP ^8.3

Since Jul 5Pushed 2d agoCompare

[ Source](https://github.com/alvipan/via-sdk)[ Packagist](https://packagist.org/packages/ashvia/sdk)[ RSS](/packages/ashvia-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

ASHVIA PHP SDK
==============

[](#ashvia-php-sdk)

Official PHP SDK for the ASHVIA ecosystem.

Instalasi
---------

[](#instalasi)

```
composer require ashvia/sdk
```

Jika sedang mengerjakan dari repositori lokal, jalankan:

```
composer install
```

Konfigurasi
-----------

[](#konfigurasi)

Konfigurasi dapat dilakukan dengan builder atau langsung membuat objek `Config`.

### Menggunakan builder

[](#menggunakan-builder)

```
use Ashvia\Sdk\Ashvia;

$sdk = Ashvia::builder()
    ->baseUrl('https://passport.example.test')
    ->clientId('client-id')
    ->clientSecret('client-secret')
    ->redirectUri('https://app.example.test/callback')
    ->build();
```

### Menggunakan `Config`

[](#menggunakan-config)

```
use Ashvia\Sdk\Ashvia;
use Ashvia\Sdk\Config\Config;

$config = new Config(
    baseUrl: 'https://passport.example.test',
    clientId: 'client-id',
    clientSecret: 'client-secret',
    redirectUri: 'https://app.example.com/callback',
);

$sdk = new Ashvia(config: $config);
```

Login OAuth
-----------

[](#login-oauth)

### 1. Mendapatkan URL otorisasi

[](#1-mendapatkan-url-otorisasi)

Gunakan method `authorizationUrl()` pada resource `auth()` untuk mengarahkan pengguna ke halaman login.

```
$authUrl = $sdk->auth()->authorizationUrl('state-123');

echo $authUrl;
```

### 2. Menukar authorization code dengan access token

[](#2-menukar-authorization-code-dengan-access-token)

Setelah pengguna kembali ke aplikasi dengan `code`, panggil `token()`.

```
$accessToken = $sdk->auth()->token('authorization-code');

echo $accessToken->accessToken();
```

### 3. Refresh token

[](#3-refresh-token)

Untuk memperbarui token akses:

```
$newToken = $sdk->auth()->refresh('refresh-token');
```

Contoh penggunaan
-----------------

[](#contoh-penggunaan)

```
use Ashvia\Sdk\Ashvia;

$sdk = Ashvia::builder()
    ->baseUrl('https://passport.example.test')
    ->clientId('client-id')
    ->clientSecret('client-secret')
    ->redirectUri('https://app.example.test/callback')
    ->build();

// Dapatkan URL otorisasi
$authorizationUrl = $sdk->auth()->authorizationUrl('request-state');

// Setelah mendapatkan authorization code:
$token = $sdk->auth()->token('authorization-code');

// Ambil data user
$user = $sdk->user()->current($token->accessToken());

if ($response->successful()) {
    $user = $response->json();
    print_r($user);
}
```

License
-------

[](#license)

This library is released under the MIT License.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

2d ago

Major Versions

v0.1.0 → v1.0.02026-07-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17959779?v=4)[Muhammad Irfan](/maintainers/alvipan)[@alvipan](https://github.com/alvipan)

---

Top Contributors

[![alvipan](https://avatars.githubusercontent.com/u/17959779?v=4)](https://github.com/alvipan "alvipan (4 commits)")

---

Tags

phpapisdkashvia

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M90](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2312.4M25](/packages/php-opencloud-openstack)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

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