New:Socket for Asana Is Now Available.Learn more
Sign In

@authon/shared

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@authon/shared

Shared types and constants for Authon SDKs

latest
Source
npmnpm
Version
0.7.17
Version published
Weekly downloads
19
-29.63%
Maintainers
1
Weekly downloads
 
Created
Source

English | 한국어

@authon/shared

Shared types and constants for all Authon SDKs

npm version License

Internal package consumed by @authon/js, @authon/react, and all other Authon frontend SDKs. Not intended for direct application use -- install the appropriate framework SDK instead.

Prerequisites

Before installing the SDK, create an Authon project and get your API keys:

  • Create a project at Authon Dashboard

    • Click "Create Project" and enter your app name
    • Select the authentication methods you want (Email/Password, OAuth providers, etc.)
  • Get your API keys from Project Settings → API Keys

    • Publishable Key (pk_live_...) — use in your frontend code
    • Test Key (pk_test_...) — for development, enables Dev Teleport
  • Configure OAuth providers (optional) in Project Settings → OAuth

    • Add Google, Apple, GitHub, etc. with their respective Client ID and Secret
    • Set the redirect URL to https://api.authon.dev/v1/auth/oauth/redirect

Test vs Live keys: Use pk_test_... during development. Switch to pk_live_... before deploying to production. Test keys use a sandbox environment with no rate limits.

Install

npm install @authon/shared

Quick Start

import type {
  AuthonUser,
  AuthTokens,
  OAuthProviderType,
  PasskeyCredential,
  Web3Wallet,
  MfaSetupResponse,
  SessionInfo,
  BrandingConfig,
  WebhookEvent,
  AuthonOrganization,
} from '@authon/shared';

import {
  OAUTH_PROVIDERS,
  PROVIDER_DISPLAY_NAMES,
  PROVIDER_COLORS,
  WEBHOOK_EVENTS,
  API_KEY_PREFIXES,
  DEFAULT_BRANDING,
  DEFAULT_SESSION_CONFIG,
  AUDIT_EVENTS,
} from '@authon/shared';

Common Tasks

Import User Type

import type { AuthonUser } from '@authon/shared';

function greet(user: AuthonUser) {
  return `Hello, ${user.displayName ?? user.email}`;
}

Get Provider Colors for Custom Buttons

import { PROVIDER_COLORS, PROVIDER_DISPLAY_NAMES } from '@authon/shared';

const google = PROVIDER_COLORS.google;
// { bg: '#ffffff', text: '#1f1f1f' }

const label = PROVIDER_DISPLAY_NAMES.google;
// 'Google'

Check API Key Type

import { API_KEY_PREFIXES } from '@authon/shared';

function isSecretKey(key: string) {
  return key.startsWith(API_KEY_PREFIXES.SECRET_LIVE) || key.startsWith(API_KEY_PREFIXES.SECRET_TEST);
}

Environment Variables

Not applicable -- this is a types-only package. See the framework-specific SDK for environment variable setup.

API Reference

Types

TypeDescription
AuthonUserUser object (id, email, displayName, avatarUrl, metadata, etc.)
AuthTokens{ accessToken, refreshToken, expiresIn, user }
OAuthProviderType'google' | 'apple' | 'github' | 'discord' | ... (10 providers)
PasskeyCredential{ id, name, createdAt, lastUsedAt }
Web3Wallet{ id, address, chain, walletType, chainId }
Web3Chain'evm' | 'solana'
Web3WalletType'metamask' | 'phantom' | 'walletconnect' | ...
MfaSetupResponse{ secret, qrCodeUri, backupCodes }
MfaStatus{ enabled, backupCodesRemaining }
SessionInfo{ id, ipAddress, userAgent, createdAt, lastActiveAt }
BrandingConfigVisual customization for the auth modal
WebhookEvent{ id, type, projectId, timestamp, data }
AuthonOrganizationOrganization with id, name, slug, members

Constants

ConstantValue
OAUTH_PROVIDERS['google', 'apple', 'kakao', 'naver', 'facebook', 'github', 'discord', 'x', 'line', 'microsoft']
WEBHOOK_EVENTS['user.created', 'user.updated', 'user.deleted', ...]
API_KEY_PREFIXES{ PUBLISHABLE_LIVE: 'pk_live_', SECRET_LIVE: 'sk_live_', ... }
DEFAULT_BRANDINGDefault modal theme colors and settings
DEFAULT_SESSION_CONFIG{ accessTokenTtl: 900, refreshTokenTtl: 604800, maxSessions: 5 }
AUDIT_EVENTSAudit log event type constants

Comparison

FeatureAuthonClerkAuth.js
PricingFree$25/mo+Free
Shared types packageYesYesNo
OAuth providers10+20+80+

License

MIT

Keywords

authon

FAQs

Package last updated on 21 Aug 2026

Related posts