SDKs
Official YorAuth client libraries for integrating authentication and authorization into your applications. The SDKs provide a clean, typed interface over the YorAuth REST API, handling token management, request signing, and error handling automatically.
The YorAuth SDKs are currently in development. This documentation describes the intended API and developer experience. Sign up for early access at yorauth.com.
Available SDKs
| SDK | Package | Language | Status |
|---|---|---|---|
| JavaScript / TypeScript | @yorauth/js-sdk | JavaScript, TypeScript | In development |
| PHP | yorauth/php-sdk | PHP 8.1+ | In development |
| Laravel | yorauth/laravel-sdk | PHP 8.1+ / Laravel 10+ | In development |
| Python | yorauth-python | Python 3.10+ | Planned |
| Go | github.com/yorauth/go-sdk | Go 1.21+ | Planned |
| Ruby | yorauth | Ruby 3.1+ | Planned |
Feature Comparison
| Feature | JavaScript | PHP | Laravel |
|---|---|---|---|
| User registration | Yes | Yes | Yes |
| Email/password login | Yes | Yes | Yes |
| Magic link (passwordless) | Yes | Yes | Yes |
| MFA (TOTP) | Yes | Yes | Yes |
| Passkeys (WebAuthn) | Yes | Yes | Yes |
| SAML SSO | Yes | Yes | Yes |
| CAPTCHA integration | Yes | Yes | Yes |
| Token refresh (automatic) | Yes | Manual | Manual |
| Role management | Yes | Yes | Yes |
| Permission checks | Yes | Yes | Yes |
| Bulk permission checks | Yes | Yes | Yes |
| User attributes (ABAC) | Yes | Yes | Yes |
| OIDC client credentials | Yes | Yes | Yes |
| OIDC device authorization | Yes | Yes | Yes |
| OIDC RP-initiated logout | Yes | Yes | Yes |
| GDPR consent withdrawal | Yes | Yes | Yes |
| Webhook handling | Yes | Yes | Yes (auto) |
| Laravel integration | - | - | Yes |
| OIDC login routes | - | - | Yes |
| Auth middleware | - | - | Yes |
| React / Next.js helpers | Yes | - | - |
| Vue helpers | Yes | - | - |
| TypeScript types (built-in) | Yes | - | - |
Base URL
All SDKs require an explicit baseUrl configuration. YorAuth supports custom domains and whitelabeling, so there is no default base URL.
Quick Start
Both SDKs require an application ID and an API key. Create an application and generate an API key in the YorAuth Dashboard.
npm install @yorauth/js-sdk
import { YorAuth } from '@yorauth/js-sdk';
const yorauth = new YorAuth({
applicationId: 'your-application-id',
apiKey: 'your-api-key',
baseUrl: 'https://your-yorauth-domain.com',
});
const { data } = await yorauth.auth.login({
email: 'user@example.com',
password: 'secret',
});
composer require yorauth/php-sdk
use YorAuth\Sdk\YorAuth;
$yorauth = new YorAuth('your-application-id', [
'baseUrl' => env('YORAUTH_BASE_URL'),
'apiKey' => 'your-api-key',
]);
$session = $yorauth->auth()->login('user@example.com', 'secret');
API Versioning
The SDKs target API version 1 (/api/v1/). Breaking changes will be communicated through SDK major version bumps.
Further Reading
- JavaScript SDK -- Full JavaScript and TypeScript reference
- PHP SDK -- Full PHP reference
- Laravel SDK -- Laravel integration with OIDC routes, middleware, and webhooks