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 1w 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

26

—

LowBetter than 40% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

674d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/71494064?v=4)[weijiajia](/maintainers/jackchang1025)[@jackchang1025](https://github.com/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

[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k382.4M3.7k](/packages/symfony-cache)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

568591.1k63](/packages/ecotone-ecotone)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.5M254](/packages/api-platform-metadata)[mimmi20/browser-detector

Library to detect Browsers and Devices

49158.4k5](/packages/mimmi20-browser-detector)

PHPackages © 2026

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