Skip to main content

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

SDKPackageLanguageStatus
JavaScript / TypeScript@yorauth/js-sdkJavaScript, TypeScriptIn development
PHPyorauth/php-sdkPHP 8.1+In development
Laravelyorauth/laravel-sdkPHP 8.1+ / Laravel 10+In development
Pythonyorauth-pythonPython 3.10+Planned
Gogithub.com/yorauth/go-sdkGo 1.21+Planned
RubyyorauthRuby 3.1+Planned

Feature Comparison

FeatureJavaScriptPHPLaravel
User registrationYesYesYes
Email/password loginYesYesYes
Magic link (passwordless)YesYesYes
MFA (TOTP)YesYesYes
Passkeys (WebAuthn)YesYesYes
SAML SSOYesYesYes
CAPTCHA integrationYesYesYes
Token refresh (automatic)YesManualManual
Role managementYesYesYes
Permission checksYesYesYes
Bulk permission checksYesYesYes
User attributes (ABAC)YesYesYes
OIDC client credentialsYesYesYes
OIDC device authorizationYesYesYes
OIDC RP-initiated logoutYesYesYes
GDPR consent withdrawalYesYesYes
Webhook handlingYesYesYes (auto)
Laravel integration--Yes
OIDC login routes--Yes
Auth middleware--Yes
React / Next.js helpersYes--
Vue helpersYes--
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.

bash
npm install @yorauth/js-sdk
typescript
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',
});
bash
composer require yorauth/php-sdk
php
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