Skip to content

Commit

Permalink
Update README.md (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkohei authored Sep 7, 2022
1 parent f8457f1 commit 614302f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ $ composer require incudata-loghy/loghy-php
<?php
use Loghy\SDK\Loghy;

$loghy = new Loghy('{YOUR_API_KEY}', '{YOUR_SITE_CODE}');
$loghy = new Loghy('{YOUR_SITE_CODE}');
```

### Get authenticated user from authorization code

```php
<?php

$user = $loghy->setCode($code)->user();
$user = $loghy->user($code);

$loghyId = $user->getLoghyId();
$name = $user->getName();
$email = $user->getEmail();
```

### Set the user ID issued by your sites to Loghy ID

```php
$loghy->putUserId('{YOUR_USER_ID}', '{YOUR_LOGHY_ID}');
```

0 comments on commit 614302f

Please sign in to comment.