JavaScript / TypeScript SDK
:::info Coming Soon This feature is under active development. The design below reflects our planned implementation. :::
The Aero2 JavaScript SDK will provide a client library for both browser and Node.js environments, making it easy to integrate authentication into any JavaScript or TypeScript application.
Planned Features
AeroClientclass — Core client for browser and Node.js- OAuth2 PKCE flow — Handled automatically, no manual PKCE management
- MFA support — Built-in handling for multi-factor authentication challenges
- TypeScript types — Full type definitions for all API responses
- Token management — Automatic token refresh and secure storage
Planned API
import { AeroClient } from '@aero2/sdk-js';
const aero = new AeroClient({
appUrl: 'https://your-app.aero2.dev',
clientId: 'your-client-id',
});
// Sign in — redirects to Aero2
await aero.signIn();
// Sign up — redirects to Aero2 signup page
await aero.signUp();
// Sign out — clears session
await aero.signOut();
// Get current session
const session = await aero.getSession();
// Get current user
const user = await aero.getUser();
// Get access token (refreshes automatically if expired)
const token = await aero.getToken();Installation
The SDK will be published as @aero2/sdk-js on npm:
npm install @aero2/sdk-jsRelated
- React Components — Pre-built UI components
- REST API Patterns — Direct API usage without an SDK
- Add Auth to a React App — Integration guide