Download the PHP package oneduo/github-sdk-php without Composer
On this page you can find all versions of the php package oneduo/github-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oneduo/github-sdk-php
More information about oneduo/github-sdk-php
Files in oneduo/github-sdk-php
Package github-sdk-php
Short Description PHP SDK for the GitHub REST API – OpenAPI based and fully typed for seamless integration
License MIT
Homepage https://github.com/oneduo/github-sdk-php
Informations about the package github-sdk-php
GitHub SDK for PHP
A fully typed, modern PHP client for the GitHub REST API v3, built on top of Saloon. This SDK provides a clean, intuitive, and fluent interface for interacting with all GitHub API endpoints, leveraging Saloon's powerful features for authentication, request building, and extensibility.
Installation
Install via Composer:
Documentation
- GitHub REST API: https://docs.github.com/en/rest
- Saloon Documentation: https://docs.saloon.dev/
Basic Usage
Initialize the Connector
Example: Fetch a Public Repository (No Authentication Required)
Example: List Public Users (No Authentication Required)
Example: Get User Information (No Authentication Required)
Authentication
This SDK supports the most common authentication methods for the GitHub API using Saloon authenticators:
Bearer Token Authentication (Recommended for GitHub)
The TokenAuthenticator
class adds an Authorization: Bearer
header to requests:
Basic Auth (Base64 Encoded)
GitHub App Authentication
For GitHub Apps, you can use the included AppAuthenticator
that generates JWT tokens:
The AppAuthenticator
supports:
- File paths: String path to your private key file
- Key content: Raw private key content as a string
- OpenSSL resources:
OpenSSLAsymmetricKey
objects (PHP 8.0+) - Passphrases: Optional encryption passphrase for protected keys
For more authentication strategies (query, certificate, header, multiple, custom, etc.), see the Saloon Authentication Documentation.
Advanced Usage
Example: List Repositories for an Organization
Example: Create a Repository (Authenticated)
Custom Requests
You can send custom requests using Saloon's request system. For example, to call an undocumented or custom endpoint:
[!TIP] Explore Saloon's documentation for more on custom requests, plugins, and advanced features.
More Examples
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Charaf Rezrazi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.