Something went wrong. Try again.
AtAuth forked from bkb.arcnode.xyz/atauth
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283/** * atauth - AT Protocol Authentication Library * * A generic, plug-and-play authentication library for AT Protocol (Bluesky) OAuth integration. * * @example * ```typescript * import { decodeToken, handleCallback, redirectToAuth } from 'atauth'; * * // Redirect to authentication * redirectToAuth({ * gatewayUrl: 'https://auth.example.com', * appId: 'myapp', * callbackUrl: 'https://myapp.com/auth/callback', * }); * * // Handle callback * const result = handleCallback({ gatewayUrl: 'https://auth.example.com' }); * if (result.success) { * console.log('Authenticated as:', result.user?.handle); * } * ``` * * @packageDocumentation */
// Typesexport type { TokenPayload, AuthState, AuthActions, AuthStore, AtAuthConfig, OAuthState, OAuthCallbackResult,} from './types';
// Token utilitiesexport { decodeToken, isTokenExpired, getTokenRemainingSeconds, getTokenAgeSeconds, shouldRefreshToken, getDisplayName, isValidDid, isValidHandle,} from './token';
// Storage utilitiesexport { storeToken, getStoredToken, removeStoredToken, hasStoredToken, storeOAuthState, getOAuthState, generateNonce,} from './storage';
// OAuth utilitiesexport { buildAuthUrl, redirectToAuth, handleCallback, isOAuthCallback, buildLogoutUrl,} from './oauth';
// Validation utilitiesexport { parseOAuthState, isValidAppId, requireHttpsInProduction, validateGatewayUrl, validateCallbackUrl,} from './validation';
/** * Library version (imported from package.json) */export const VERSION = '1.2.0';