SDKs & Libraries
Auris provides official client libraries for all major platforms and frameworks. Every SDK wraps the same underlying OAuth2 PKCE flow and REST API, with framework-specific conveniences added on top.
SDK Comparison
The table below summarizes which capabilities are available in each package.
Which SDK to Choose
Use this decision tree to select the right package for your project.
Building a browser Single Page Application (React, Vue, plain JS)?
Use @auris/js for framework-agnostic code, or @auris/react for React-specific hooks and components.
Building a Next.js application?
Use @auris/nextjs. It re-exports @auris/react for Client Components and adds server-side helpers for Server Components, Route Handlers, and Edge Middleware.
Building a PHP or Laravel application?
Use the auris/sdk Composer package. It is pure PHP with no external dependencies and supports PHP 7.4 and above.
Running a WordPress site?
Use the auris-sso WordPress plugin. It handles SSO login, just-in-time user provisioning, and role mapping through the WordPress admin UI.
Writing scripts, CI/CD pipelines, or automating tenant management?
Use @auris/cli. Install it globally and authenticate once — then use auris users list, auris logs, and other commands in your scripts.
Server-to-server API calls (no user involved)?
Use @auris/js with the getM2MToken() method, or createManagementClient() in @auris/nextjs/server. Both use the OAuth2 client_credentials grant.
Installation
# JavaScript (browser, Node.js, edge runtimes)
npm install @auris/js
# React
npm install @auris/react @auris/js
# Next.js (includes React and JS packages)
npm install @auris/nextjs @auris/react @auris/js
# PHP
composer require auris/sdk
# CLI (global install)
npm install -g @auris/cliThe WordPress plugin is distributed as a .zip file. Install it through Plugins → Add New → Upload Plugin in the WordPress admin.
Quick Start Examples
JavaScript
import { AurisClient } from '@auris/js'
const auris = new AurisClient({
domain: 'auth.yourdomain.com',
clientId: 'app_xxxxx',
redirectUri: 'http://localhost:3000/callback',
})
// Redirect the user to the hosted login page
await auris.loginWithRedirect()
// On your callback page, complete the flow
const result = await auris.handleRedirectCallback()
console.log(result.user)React
import { AurisProvider, useAuris } from '@auris/react'
function App() {
return (
<AurisProvider domain="auth.yourdomain.com" clientId="app_xxxxx">
<LoginButton />
</AurisProvider>
)
}
function LoginButton() {
const { loginWithRedirect, logout, isAuthenticated, user } = useAuris()
if (isAuthenticated) {
return <button onClick={() => logout()}>Sign out ({user.email})</button>
}
return <button onClick={loginWithRedirect}>Sign in</button>
}Next.js
// middleware.ts
import { aurisMiddleware } from '@auris/nextjs/middleware'
export default aurisMiddleware({
protectedPaths: ['/dashboard(.*)'],
loginUrl: '/auth/login',
})
// app/dashboard/page.tsx (Server Component)
import { getSession } from '@auris/nextjs/server'
import { redirect } from 'next/navigation'
export default async function DashboardPage() {
const session = await getSession()
if (!session) redirect('/auth/login')
return <h1>Welcome, {session.user.name}</h1>
}PHP
<?php
require 'vendor/autoload.php';
use Auris\AurisClient;
use Auris\AurisConfig;
$config = new AurisConfig(
domain: 'auth.yourdomain.com',
clientId: 'your-client-id',
redirectUri: 'https://yourapp.com/callback.php'
);
$auris = new AurisClient($config);
// login.php
session_start();
header('Location: ' . $auris->getLoginUrl());
exit;
// callback.php
session_start();
$result = $auris->handleCallback($_GET['code'], $_GET['state']);
$_SESSION['user'] = $result->getUser();Version Compatibility
All JavaScript SDKs ship both ESM (import) and CJS (require) builds, plus TypeScript declaration files. They do not require a bundler — you can use them directly in Node.js or modern browsers that support ES modules.
All packages follow semantic versioning. Breaking API changes are only introduced in major version bumps and are documented in the changelog for each package.
SDK Pages
Zero-dependency SDK for browsers, Node.js, and edge runtimes. Full API reference including the AurisClient, permissions module, FGA module, management client, webhook verification, and JWT verification.
JavaScript SDKReact bindings built on top of @auris/js. AurisProvider context, hooks (useAuris, useUser, usePermissions, useFga, useOrganization), and components (AuthGuard, PermissionGate, LoginButton).
React SDKFull Next.js integration with three entry points: client-side (re-exports @auris/react), server-side helpers (getSession, withAuth, requirePermission), and Edge Middleware (aurisMiddleware).
Next.js SDKPure PHP OAuth2 PKCE implementation for PHP 7.4+ with no external dependencies. Includes vanilla PHP examples and a Laravel integration guide.
PHP SDKSSO plugin for WordPress with just-in-time user provisioning, configurable role mapping, and a login button shortcode. Requires the PHP SDK.
WordPress PluginCommand-line tool for managing your Auris tenant. Authenticate once, then manage users, roles, applications, and audit logs from the terminal or CI/CD pipelines.
CLI Tool