PHPackages                             weijiajia/phone-code - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. weijiajia/phone-code

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

weijiajia/phone-code
====================

1.0.0(1y ago)05PHPPHP ^8.2

Since Oct 12Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)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

27

—

LowBetter than 49% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

583d 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 (1 commits)")

### Embed Badge

![Health badge](/badges/weijiajia-phone-code/health.svg)

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

###  Alternatives

[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[typo3/html-sanitizer

HTML sanitizer aiming to provide XSS-safe markup based on explicitly allowed tags, attributes and values.

279.6M2](/packages/typo3-html-sanitizer)[j-ben87/parsley-bundle

Convert Symfony constraints into data-attributes for client-side validation with Parsley.

1432.7k](/packages/j-ben87-parsley-bundle)

PHPackages © 2026

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