Skip to content

Commit

Permalink
fix: readme & composer lock
Browse files Browse the repository at this point in the history
  • Loading branch information
maratsh committed Dec 12, 2024
1 parent 69ba17f commit f2cdeec
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName": "affinidi-tdk",
"projectName": "affinidi-tdk-php",
"projectOwner": "affinidi",
"repoType": "github",
"repoHost": "https://github.com",
Expand Down
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ The Affinidi Trust Development Kit (Affinidi TDK) is a modern interface that all

The Affinidi TDK provides three type of modules:

- [Clients](clients), which offer methods to access Affinidi Elements services like Credential Issuance, Credential Verification, and Login Configurations, among others.
- [Packages](packages), which are commonly used utilities/helpers that are self-contained and composable.
- [Libraries](libs), which are high-level abstractions that combine logic and data to perform necessary business logic functionalities.
- [Clients](src/Clients), which offer methods to access Affinidi Elements services like Credential Issuance, Credential Verification, and Login Configurations, among others.
- [Packages](src/), which are commonly used utilities/helpers that are self-contained and composable.
- [Libraries](src/Libs/), which are high-level abstractions that combine logic and data to perform necessary business logic functionalities.

Each module has its own README that you can check to better understand how to integrate it into your application.

Expand All @@ -27,6 +27,57 @@ To learn how to integrate Affinidi TDK and use the different modules into your a
- [Affinidi TDK Libraries](https://docs.affinidi.com/dev-tools/affinidi-tdk/libraries/)
- [Affinidi TDK Packages](https://docs.affinidi.com/dev-tools/affinidi-tdk/packages/)

## Install

```bash
composer install affinidi-tdk/affinidi-tdk-php
```

## Usage

```php
<?php

require_once 'vendor/autoload.php';

use AuthProvider\AuthProvider;
use AffinidiTdk\Clients\Wallets as WalletsClient;

$params = [
'privateKey' => "",
// 'apiGatewayUrl' => 'https://apse1.api.affinidi.io',
// 'tokenEndpoint' => 'https://apse1.auth.developer.affinidi.io/auth/oauth2/token',
'keyId' => '',
'passphrase' => '',
'projectId' => '',
'tokenId' => ''
];

$authProvider = new AuthProvider($params);

try {
$tokenCallback = [$authProvider, 'fetchProjectScopedToken'];

$configCwe = WalletsClient\Configuration::getDefaultConfiguration()->setApiKey('authorization', '', $tokenCallback);

$apiInstanceCwe = new WalletsClient\Api\WalletApi(
new GuzzleHttp\Client(),
$configCwe
);

$apiInstanceCwe->listWallets();

$resultCwe = $apiInstanceCwe->listWallets();

$resultCweJson = json_decode($resultCwe, true);

print_r(count($resultCweJson['wallets']));

} catch (Exception $e) {
print_r($e->getMessage());
}
```

## Support & feedback

If you face any issues or have suggestions, please don't hesitate to contact us using [this link](https://share.hsforms.com/1i-4HKZRXSsmENzXtPdIG4g8oa2v).
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/AuthProvider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Install

```bash
composer install affinidi-tdk/affinidi-tdk-php affinidi-tdk/wallets-client
composer install affinidi-tdk/affinidi-tdk-php
```

## Usage
Expand Down

0 comments on commit f2cdeec

Please sign in to comment.