Skip to Content
SDKsOverview

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.

Feature@auris/js@auris/react@auris/nextjsauris/sdk (PHP)auris-sso (WP)@auris/cli
AuthenticationYesYesYesYesYesN/A
OAuth2 PKCEYesYesYesYesYesN/A
Social LoginYesYesYesNoNoN/A
Magic LinksYesYesYesNoNoN/A
SMS OTPYesYesYesNoNoN/A
Permissions checkYesYes (hooks)Yes (server)NoNoNo
Fine-Grained AuthorizationYesYes (hooks)Yes (server)NoNoNo
Management APIYesNoYes (server)NoNoYes
Webhook verificationYesNoNoNoNoNo
JWT verificationYesNoYes (server)NoNoNo
SSR supportYesNoYesYesN/AN/A
Edge runtimeYesNoYes (middleware)NoN/AN/A
Zero dependenciesYesNoNoYesNoNo

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/cli

The 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

PackageMin Node.jsMin PHPMin WordPress
@auris/js18.0N/AN/A
@auris/react18.0N/AN/A
@auris/nextjs18.0N/AN/A
auris/sdkN/A7.4N/A
auris-ssoN/A7.45.0
@auris/cli18.0N/AN/A

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