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

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

weijiajia/apple-client
======================

A powerful PHP client for interacting with Apple services

1.0.1(1y ago)491[1 issues](https://github.com/jackchang1025/apple-client/issues)MITPHPPHP ^8.2

Since Oct 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/jackchang1025/apple-client)[ Packagist](https://packagist.org/packages/weijiajia/apple-client)[ RSS](/packages/weijiajia-apple-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

Apple Client
============

[](#apple-client)

[![CN doc](https://camo.githubusercontent.com/509cdb11ce87781d605e01c95c7839ff3ff5f29524ddf3a79bfdc25b4c030df3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545362539362538372545362541312541332d2545342542382541442545362539362538372545372538392538382d626c75652e737667)](README_CN.md)

Introduction
------------

[](#introduction)

Apple Client is a PHP library that integrates the [Saloon HTTP](https://docs.saloon.dev/) client to simulate Apple browser client interactions with various Apple services. It provides a simple and flexible interface for developers to easily integrate Apple's authentication, account management, and other related functionalities into their applications.

**Note:** Before using the Apple Client library, you may need to reverse engineer Apple's login process and find the algorithm for encrypting account and password.

### Key Features:

[](#key-features)

- Apple ID Authentication
- Account Management
- Phone Number Verification
- Security Code Validation
- Flexible Configuration Management
- Robust Error Handling

System Requirements
-------------------

[](#system-requirements)

- PHP 8.2 or higher
- Composer
- ext-simplexml
- ext-dom
- ext-libxml

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

[](#installation)

Install Apple Client using Composer:

```
composer require weijiajia/apple-client
```

Usage Examples
--------------

[](#usage-examples)

1. Create an AppleClient instance:

```
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use Weijiajia\AppleClient;
use Weijiajia\AppleClientFactory;
use Weijiajia\Cookies\Cookies;
use Weijiajia\Store\CacheStore;

$config =  Config::fromArray([
    'apple_auth' => [
    'url' => 'https://your_apple_auth_url',
 ]);

// Configuration
$cookie = new Cookies(cache: new CacheInterface());

// For managing multiple accounts
$cookie = new Cookies(cache: new CacheInterface(),'your_account_name');

// Logging
$logger = new LoggerInterface();

// Synchronize and persist headers
 $headerRepositories = new CacheStore(
            cache: new CacheInterface(),
            key: 'your_account_name',
            defaultData: [
            'scnt' => 'value',
            ]
        );

// Create AppleClient instance
$client = new AppleClient(config: $config, headerRepositories: $headerRepositories,cookieJar: $cookie,logger: $logger);

// Or use AppleFactory
$factory = new AppleClientFactory(cache: $cache, logger: $logger);
$client = $factory->create('your_client_id', [
    'apple_auth' => [
    'url' => 'https://your_apple_auth_url',
    ],
]);

// Custom configuration
$client->withConfig([
'timeOutInterval' => 30,
]);
// Use proxy
$client->setProxy('http://proxy.example.com:8080');
```

2. Perform Apple ID Authentication:

```
// login
$response = $client->authLogin('user@example.com', 'your_password');

// Two-factor authentication
$response = $client->verifySecurityCode('your_security_code');

// get token:
$response = $client->token();
```

Important Notes
---------------

[](#important-notes)

This project is for learning and research purposes only. Do not use it for illegal purposes. Usage may violate Apple's terms of service, please use with caution. Ensure that your network environment can access Apple websites normally.

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Contact
-------

[](#contact)

If you have any questions or suggestions, please contact:

-

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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 ~1 days

Total

2

Last Release

581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/636557533fde1107bb301eca908de1c17c9ea7073d5c9c0fbad725ccd0800bde?d=identicon)[jackchang1025](/maintainers/jackchang1025)

---

Top Contributors

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

---

Tags

phpapiclientAuthentication2faTwo Factor Authenticationoauthsaloonapplephone verificationapple idAccount managementsecurity-codeapple-authapple-servicesidmsa

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/weijiajia-apple-client/health.svg)

```
[![Health](https://phpackages.com/badges/weijiajia-apple-client/health.svg)](https://phpackages.com/packages/weijiajia-apple-client)
```

###  Alternatives

[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)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

194.1k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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