PHPackages                             austinw/usagym-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. [API Development](/categories/api)
4. /
5. austinw/usagym-sdk

ActiveLibrary[API Development](/categories/api)

austinw/usagym-sdk
==================

USA Gymnastics SDK for PHP

v3.0.0(2mo ago)03.8k↑778.6%1MITPHPPHP ^8.3CI passing

Since Jun 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/AustinW/usagym-sdk)[ Packagist](https://packagist.org/packages/austinw/usagym-sdk)[ RSS](/packages/austinw-usagym-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (8)Dependencies (14)Versions (11)Used By (0)

USA Gymnastics SDK
==================

[](#usa-gymnastics-sdk)

[![Tests](https://github.com/AustinW/usagym-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/AustinW/usagym-sdk/actions/workflows/tests.yml)[![Latest Version](https://camo.githubusercontent.com/450e07c890f39a69bb45dbdfe3d35afac8e11d656e78311082124e49948304da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61757374696e772f75736167796d2d73646b2e737667)](https://packagist.org/packages/austinw/usagym-sdk)[![PHP Version](https://camo.githubusercontent.com/3028bab28507bd1d372886904af931b4645da0a820d97c7b91584515d5b2b7d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61757374696e772f75736167796d2d73646b2e737667)](https://packagist.org/packages/austinw/usagym-sdk)[![License](https://camo.githubusercontent.com/aadd3c64ce79e7f2621061e452406ffb421ff9cdfaeca7b2a96a51e779bdf150/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61757374696e772f75736167796d2d73646b2e737667)](https://packagist.org/packages/austinw/usagym-sdk)

A modern PHP SDK for the USA Gymnastics API v4, built with [SaloonPHP](https://docs.saloon.dev/).

Requirements
------------

[](#requirements)

- PHP 8.3+
- Composer

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

[](#installation)

```
composer require austinw/usagym-sdk
```

Quick Start
-----------

[](#quick-start)

```
use AustinW\UsaGym\UsaGym;

$usagym = new UsaGym(
    username: 'your-username',
    password: 'your-password'
);

// Test credentials
if ($usagym->test()) {
    echo "Connected successfully!";
}
```

Usage
-----

[](#usage)

### Get Disciplines

[](#get-disciplines)

```
$disciplines = $usagym->disciplines()->all();

foreach ($disciplines as $discipline) {
    echo "{$discipline->code}: {$discipline->fullName}\n";
}
```

### Verify Person Exists

[](#verify-person-exists)

```
$exists = $usagym->person()->exists(
    memberId: '123456',
    lastName: 'Smith',
    dateOfBirth: '2010-05-15'
);
```

### Sanction Reservations

[](#sanction-reservations)

```
// Get all athletes for a sanction
$athletes = $usagym->sanctions(58025)->reservations()->athletes();

// Filter by club
$athletes = $usagym->sanctions(58025)->reservations()->athletes(
    clubs: [12345, 67890]
);

// Filter by level using type-safe enums
use AustinW\UsaGym\Enums\Levels\WomensArtisticLevel;

$level4Athletes = $usagym->sanctions(58025)->reservations()->athletes(
    levels: [WomensArtisticLevel::Level4, WomensArtisticLevel::Level5]
);

// Get coaches
$coaches = $usagym->sanctions(58025)->reservations()->coaches();

// Get judges
$judges = $usagym->sanctions(58025)->reservations()->judges();

// Get clubs
$clubs = $usagym->sanctions(58025)->reservations()->clubs();

// Get groups (for Rhythmic, Acro, T&T, GFA)
$groups = $usagym->sanctions(58025)->reservations()->groups();

// Get all individuals (athletes + coaches)
$individuals = $usagym->sanctions(58025)->reservations()->individuals();
// Returns: ['athletes' => [...], 'coaches' => [...]]
```

### Concurrent Requests

[](#concurrent-requests)

Fetch all athletes across all clubs concurrently:

```
$allAthletes = $usagym->sanctions(58025)
    ->reservations()
    ->allAthletesConcurrently(concurrency: 10);

// Or get total count
$count = $usagym->sanctions(58025)
    ->reservations()
    ->totalAthleteCount();
```

### Verification

[](#verification)

```
// Verify athletes
$results = $usagym->sanctions(58025)->verification()->athletes(['123456', '789012']);

foreach ($results as $result) {
    if ($result->eligible) {
        echo "{$result->fullName()} is eligible\n";
    } else {
        echo "{$result->fullName()} is not eligible: {$result->ineligibleReason}\n";
    }
}

// Verify single athlete
$athlete = $usagym->sanctions(58025)->verification()->athlete('123456');

// Verify coaches
$coaches = $usagym->sanctions(58025)->verification()->coaches(['123456']);

// Verify judges (includes certification info)
$judges = $usagym->sanctions(58025)->verification()->judges(['123456']);

// Verify coach email
$isValid = $usagym->sanctions(58025)->verification()->coachEmail(
    refType: 'person',
    refTypeId: '123456',
    email: 'coach@example.com'
);

// Verify legal contact email
$isValid = $usagym->sanctions(58025)->verification()->legalContactEmail(
    refType: 'person',
    refTypeId: '123456',
    email: 'parent@example.com'
);
```

Level Enums
-----------

[](#level-enums)

Type-safe enums are provided for all disciplines:

```
use AustinW\UsaGym\Enums\Levels\WomensArtisticLevel;
use AustinW\UsaGym\Enums\Levels\MensArtisticLevel;
use AustinW\UsaGym\Enums\Levels\RhythmicLevel;
use AustinW\UsaGym\Enums\Levels\AcrobaticLevel;
use AustinW\UsaGym\Enums\Levels\TrampolineLevel;
use AustinW\UsaGym\Enums\Levels\GfaLevel;

// Women's Artistic
WomensArtisticLevel::Bronze;    // Xcel Bronze
WomensArtisticLevel::Level4;    // JO Level 4
WomensArtisticLevel::Elite;     // Elite

// Men's Artistic
MensArtisticLevel::Level6JN;    // Level 6 Junior National
MensArtisticLevel::Level10JEJunior; // Level 10 Junior Elite Jr

// Rhythmic
RhythmicLevel::GroupAdvanced;   // Group Advanced

// And many more...
```

Laravel Integration
-------------------

[](#laravel-integration)

### Configuration

[](#configuration)

The package auto-registers its service provider. Publish the config file:

```
php artisan vendor:publish --tag=usagym-config
```

Add your credentials to `.env`:

```
USAGYM_USERNAME=your-username
USAGYM_PASSWORD=your-password
```

### Usage with Dependency Injection

[](#usage-with-dependency-injection)

```
use AustinW\UsaGym\UsaGym;

class MeetController extends Controller
{
    public function __construct(
        private UsaGym $usagym
    ) {}

    public function athletes(int $sanctionId)
    {
        return $this->usagym
            ->sanctions($sanctionId)
            ->reservations()
            ->athletes();
    }
}
```

### Usage with Facade

[](#usage-with-facade)

```
use AustinW\UsaGym\Laravel\Facades\UsaGym;

$athletes = UsaGym::sanctions(58025)->reservations()->athletes();
```

Data Transfer Objects
---------------------

[](#data-transfer-objects)

All API responses are mapped to readonly DTOs:

```
// AthleteReservation
$athlete->memberId;
$athlete->firstName;
$athlete->lastName;
$athlete->fullName();        // "John Doe"
$athlete->dateOfBirth;       // DateTimeImmutable
$athlete->discipline;        // Discipline enum
$athlete->level;             // "Gold"
$athlete->status;            // MemberStatus enum
$athlete->canCompete();      // bool

// ClubReservation
$club->clubId;
$club->clubName;
$club->displayName();        // Abbreviation or full name
$club->location();           // "City, ST"

// VerificationResult
$result->eligible;
$result->ineligibleReason;
$result->certificationValid;
$result->certificationLevels;
```

Error Handling
--------------

[](#error-handling)

```
use AustinW\UsaGym\Exceptions\UsaGymException;
use AustinW\UsaGym\Exceptions\AuthenticationException;
use AustinW\UsaGym\Exceptions\ValidationException;
use AustinW\UsaGym\Exceptions\NotFoundException;

try {
    $athletes = $usagym->sanctions(58025)->reservations()->athletes();
} catch (AuthenticationException $e) {
    // Invalid credentials
} catch (ValidationException $e) {
    // Validation errors
    $errors = $e->errors();
} catch (NotFoundException $e) {
    // Resource not found
} catch (UsaGymException $e) {
    // General API error
    $response = $e->getResponse();
}
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to USA Gymnastics SDK! You can read the contribution guide [here](.github/CONTRIBUTING.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/austinw/usagym-sdk/security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

USA Gymnastics SDK is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance82

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~73 days

Recently: every ~19 days

Total

10

Last Release

89d ago

Major Versions

v1.0.0 → 2.0.02026-01-11

v2.3.0 → v3.0.02026-03-27

PHP version history (3 changes)v1.0.0PHP ^7.2|^8.0

2.0.0PHP ^8.1

2.2.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/9444ae0906d85682c4700758c9ac0b7903e693557da4b6a876c11eff026bbcdc?d=identicon)[AustinW](/maintainers/AustinW)

---

Top Contributors

[![AustinW](https://avatars.githubusercontent.com/u/333398?v=4)](https://github.com/AustinW "AustinW (15 commits)")[![Hungnguyen720](https://avatars.githubusercontent.com/u/32807512?v=4)](https://github.com/Hungnguyen720 "Hungnguyen720 (1 commits)")

---

Tags

phpapisdksaloonusagymgymnastics

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

806.6M187](/packages/saloonphp-laravel-plugin)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

138106.8k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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