PHPackages                             logto/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. logto/sdk

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

logto/sdk
=========

Logto PHP SDK.

v0.3.1(2mo ago)721.7k—1.3%4[5 PRs](https://github.com/logto-io/php/pulls)1MITPHPPHP &gt;=8.1CI passing

Since Aug 12Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/logto-io/php)[ Packagist](https://packagist.org/packages/logto/sdk)[ GitHub Sponsors](https://github.com/logto-io)[ RSS](/packages/logto-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (12)Used By (1)

Logto PHP SDK
=============

[](#logto-php-sdk)

[![Logto](https://camo.githubusercontent.com/a9cdb9c304a6ff28a166e7a55b582fe765b55504cdaca1becbccc2544c30c9f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f722d6c6f67746f2d373935386666)](https://logto.io/)[![Packagist Version](https://camo.githubusercontent.com/a61bd65bc2f2a92c7bd129fd84c339c473fea5d4db4332412945b65b922ab53f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f67746f2f73646b)](https://packagist.org/packages/logto/sdk)[![Packagist PHP Version](https://camo.githubusercontent.com/23f22629758e7433fdacedda4cd160cc0f338e5087c4541ba3e751541e939ce1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6c6f67746f2f73646b2f706870)](https://packagist.org/packages/logto/sdk)[![Packagist License](https://camo.githubusercontent.com/650f4d920087a8f1105e5735ef6ca949ce57b079f161fb46f7015a7f320df266/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f67746f2f73646b)](https://github.com/logto-io/php)[![Discord](https://camo.githubusercontent.com/f8a7afa16ceef8766e0d9bd39dbb18300eb5cd22abe422ff007af8d59fc1a4e8/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3936353834353636323533353134373535313f636f6c6f723d353836356632266c6f676f3d646973636f7264266c6162656c3d646973636f7264)](https://discord.gg/vRvwuwgpVX)

Prerequisites
-------------

[](#prerequisites)

- PHP 8.1 or higher
- A [Logto Cloud](https://logto.io/) account or a self-hosted Logto
- A Logto traditional web application created

If you don't have the Logto application created, please follow the [⚡ Get started](https://docs.logto.io/docs/tutorials/get-started/) guide to create one.

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

[](#installation)

```
composer require logto/sdk
```

Tutorial
--------

[](#tutorial)

See [tutorial](./docs/tutorial.md) for a quick start.

API reference
-------------

[](#api-reference)

See [API reference](./docs/api/index.md) for more details.

Sample code
-----------

[](#sample-code)

See [samples](./samples/) directory for example usages.

Development scripts
-------------------

[](#development-scripts)

### Dev

[](#dev)

```
composer dev
```

This script will start a dev server at `http://localhost:5000` and use `samples/index.php` as the entry point.

### Test

[](#test)

```
composer test
```

### Update API docs

[](#update-api-docs)

**Prerequisite**

- A `phpDocumentor.phar` in the project root (can be downloaded from [phpDocumentor](https://docs.phpdoc.org/guide/getting-started/installing.html)).
- Command `prettier` is available in the shell (an opinionated [code formatter](https://prettier.io/)), which can be installed with `npm install -g prettier`.

```
composer docs
```

This command will generate the API docs in `docs/api` folder and format the files.

Resources
---------

[](#resources)

- [Logto website](https://logto.io/)
- [Logto documentation](https://docs.logto.io/)
- [Join Discord](https://discord.gg/vRvwuwgpVX)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance85

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~231 days

Total

5

Last Release

84d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5501b18ca146d1796de3ae7e71c302397453b04bbfd4634d5a4597cad7d0e798?d=identicon)[logto](/maintainers/logto)

---

Top Contributors

[![gao-sun](https://avatars.githubusercontent.com/u/14722250?v=4)](https://github.com/gao-sun "gao-sun (20 commits)")[![darcyYe](https://avatars.githubusercontent.com/u/15182327?v=4)](https://github.com/darcyYe "darcyYe (5 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (2 commits)")[![mikedamm](https://avatars.githubusercontent.com/u/24718?v=4)](https://github.com/mikedamm "mikedamm (1 commits)")

---

Tags

authenticationauthorizationjwtlaravellogtomfamulti-tenantoauth2oidcphpsamlsso

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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