Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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

  • AeroClient class — 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-js

Related