@authon/js 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -23,9 +23,7 @@ npm install @authon/js
23
23
  <script type="module">
24
24
  import { Authon } from '@authon/js';
25
25
 
26
- const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY', {
27
- apiUrl: 'https://your-authon-server.com',
28
- });
26
+ const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY');
29
27
 
30
28
  document.getElementById('sign-in-btn').addEventListener('click', () => {
31
29
  authon.openSignIn();
@@ -80,7 +78,6 @@ await authon.signOut();
80
78
 
81
79
  | 변수 | 필수 | 설명 |
82
80
  |------|------|------|
83
- | `AUTHON_API_URL` | Yes | Authon 서버 URL |
84
81
  | `AUTHON_PUBLISHABLE_KEY` | Yes | 프로젝트 퍼블리셔블 키 |
85
82
 
86
83
  ## 비교
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # @authon/js
4
4
 
5
- > Drop-in browser authentication SDK — self-hosted Clerk alternative, Auth0 alternative, open-source auth
5
+ > Drop-in browser authentication SDK — Auth0 alternative, open-source auth
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@authon/js?color=6d28d9)](https://www.npmjs.com/package/@authon/js)
8
8
  [![License](https://img.shields.io/badge/license-MIT-blue)](../../LICENSE)
@@ -16,8 +16,8 @@ Before installing the SDK, create an Authon project and get your API keys:
16
16
  - Select the authentication methods you want (Email/Password, OAuth providers, etc.)
17
17
 
18
18
  2. **Get your API keys** from Project Settings → API Keys
19
- - **Publishable Key** (`pk_live_...` or `pk_test_...`) — safe to use in client-side code
20
- - **Secret Key** (`sk_live_...` or `sk_test_...`) — server-side only, never expose to clients
19
+ - **Publishable Key** (`pk_live_...`) — use in your frontend code
20
+ - **Test Key** (`pk_test_...`) — for development, enables Dev Teleport
21
21
 
22
22
  3. **Configure OAuth providers** (optional) in Project Settings → OAuth
23
23
  - Add Google, Apple, GitHub, etc. with their respective Client ID and Secret
@@ -45,9 +45,7 @@ npm install @authon/js
45
45
  <script type="module">
46
46
  import { Authon } from '@authon/js';
47
47
 
48
- const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY', {
49
- apiUrl: 'https://your-authon-server.com',
50
- });
48
+ const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY');
51
49
 
52
50
  document.getElementById('sign-in-btn').addEventListener('click', () => {
53
51
  authon.openSignIn();
@@ -69,9 +67,7 @@ npm install @authon/js
69
67
  ```ts
70
68
  import { Authon } from '@authon/js';
71
69
 
72
- const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY', {
73
- apiUrl: 'https://your-authon-server.com',
74
- });
70
+ const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY');
75
71
 
76
72
  // Opens popup, falls back to redirect if blocked
77
73
  await authon.signInWithOAuth('google');
@@ -88,9 +84,7 @@ await authon.signInWithOAuth('google', { flowMode: 'redirect' });
88
84
  ```ts
89
85
  import { Authon } from '@authon/js';
90
86
 
91
- const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY', {
92
- apiUrl: 'https://your-authon-server.com',
93
- });
87
+ const authon = new Authon('pk_live_YOUR_PUBLISHABLE_KEY');
94
88
 
95
89
  // Sign up
96
90
  const user = await authon.signUpWithEmail('user@example.com', 'MyP@ssw0rd', {
@@ -181,8 +175,8 @@ authon.on('tokenRefreshed', (token) => { /* update API client */ });
181
175
 
182
176
  | Variable | Required | Description |
183
177
  |----------|----------|-------------|
184
- | `AUTHON_API_URL` | Yes | Your Authon server URL (e.g. `https://your-authon-server.com`) |
185
178
  | `AUTHON_PUBLISHABLE_KEY` | Yes | Project publishable key (`pk_live_...` or `pk_test_...`) |
179
+ | `AUTHON_API_URL` | No | Optional — defaults to `api.authon.dev` |
186
180
 
187
181
  ## API Reference
188
182
 
@@ -280,7 +274,6 @@ new Authon(publishableKey: string, config?: AuthonConfig)
280
274
 
281
275
  | Feature | Authon | Clerk | Auth.js |
282
276
  |---------|--------|-------|---------|
283
- | Self-hosted | Yes | No | Partial |
284
277
  | Pricing | Free | $25/mo+ | Free |
285
278
  | OAuth providers | 10+ | 20+ | 80+ |
286
279
  | ShadowDOM modal | Yes | No | No |
package/dist/index.cjs CHANGED
@@ -23,7 +23,9 @@ __export(index_exports, {
23
23
  Authon: () => Authon,
24
24
  AuthonMfaRequiredError: () => AuthonMfaRequiredError,
25
25
  generateQrSvg: () => generateQrSvg,
26
- getProviderButtonConfig: () => getProviderButtonConfig
26
+ getProviderButtonConfig: () => getProviderButtonConfig,
27
+ getStrings: () => getStrings,
28
+ translations: () => translations
27
29
  });
28
30
  module.exports = __toCommonJS(index_exports);
29
31
 
@@ -37,7 +39,7 @@ var AuthonMfaRequiredError = class extends Error {
37
39
  }
38
40
  };
39
41
 
40
- // ../shared/dist/index.js
42
+ // ../../node_modules/.pnpm/@authon+shared@0.3.0/node_modules/@authon/shared/dist/index.js
41
43
  var PROVIDER_DISPLAY_NAMES = {
42
44
  google: "Google",
43
45
  apple: "Apple",
@@ -100,6 +102,394 @@ function getProviderButtonConfig(provider) {
100
102
  };
101
103
  }
102
104
 
105
+ // src/i18n.ts
106
+ var translations = {
107
+ en: {
108
+ welcomeBack: "Welcome back",
109
+ createAccount: "Create your account",
110
+ alreadyHaveAccount: "Already have an account?",
111
+ dontHaveAccount: "Don't have an account?",
112
+ signIn: "Sign in",
113
+ signUp: "Sign up",
114
+ or: "or",
115
+ emailAddress: "Email address",
116
+ password: "Password",
117
+ passwordHint: "Must contain uppercase, lowercase, and a number (min 8 chars)",
118
+ continueWith: "Continue with",
119
+ connectWallet: "Connect Wallet",
120
+ magicLink: "Continue with Magic Link",
121
+ passkey: "Sign in with Passkey",
122
+ securedBy: "Secured by",
123
+ backToSignIn: "Back to sign in"
124
+ },
125
+ ko: {
126
+ welcomeBack: "\uB2E4\uC2DC \uC624\uC2E0 \uAC78 \uD658\uC601\uD569\uB2C8\uB2E4",
127
+ createAccount: "\uACC4\uC815 \uB9CC\uB4E4\uAE30",
128
+ alreadyHaveAccount: "\uC774\uBBF8 \uACC4\uC815\uC774 \uC788\uC73C\uC2E0\uAC00\uC694?",
129
+ dontHaveAccount: "\uACC4\uC815\uC774 \uC5C6\uC73C\uC2E0\uAC00\uC694?",
130
+ signIn: "\uB85C\uADF8\uC778",
131
+ signUp: "\uD68C\uC6D0\uAC00\uC785",
132
+ or: "\uB610\uB294",
133
+ emailAddress: "\uC774\uBA54\uC77C \uC8FC\uC18C",
134
+ password: "\uBE44\uBC00\uBC88\uD638",
135
+ passwordHint: "\uB300\uBB38\uC790, \uC18C\uBB38\uC790, \uC22B\uC790 \uD3EC\uD568 (\uCD5C\uC18C 8\uC790)",
136
+ continueWith: "(\uC73C)\uB85C \uACC4\uC18D\uD558\uAE30",
137
+ connectWallet: "\uC9C0\uAC11 \uC5F0\uACB0",
138
+ magicLink: "\uB9E4\uC9C1 \uB9C1\uD06C\uB85C \uACC4\uC18D\uD558\uAE30",
139
+ passkey: "\uD328\uC2A4\uD0A4\uB85C \uB85C\uADF8\uC778",
140
+ securedBy: "\uBCF4\uC548 \uC81C\uACF5",
141
+ backToSignIn: "\uB85C\uADF8\uC778\uC73C\uB85C \uB3CC\uC544\uAC00\uAE30"
142
+ },
143
+ ja: {
144
+ welcomeBack: "\u304A\u304B\u3048\u308A\u306A\u3055\u3044",
145
+ createAccount: "\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u4F5C\u6210",
146
+ alreadyHaveAccount: "\u3059\u3067\u306B\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u304A\u6301\u3061\u3067\u3059\u304B\uFF1F",
147
+ dontHaveAccount: "\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u304A\u6301\u3061\u3067\u306A\u3044\u3067\u3059\u304B\uFF1F",
148
+ signIn: "\u30ED\u30B0\u30A4\u30F3",
149
+ signUp: "\u65B0\u898F\u767B\u9332",
150
+ or: "\u307E\u305F\u306F",
151
+ emailAddress: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
152
+ password: "\u30D1\u30B9\u30EF\u30FC\u30C9",
153
+ passwordHint: "\u5927\u6587\u5B57\u3001\u5C0F\u6587\u5B57\u3001\u6570\u5B57\u3092\u542B\u3080\uFF088\u6587\u5B57\u4EE5\u4E0A\uFF09",
154
+ continueWith: "\u3067\u7D9A\u884C",
155
+ connectWallet: "\u30A6\u30A9\u30EC\u30C3\u30C8\u63A5\u7D9A",
156
+ magicLink: "\u30DE\u30B8\u30C3\u30AF\u30EA\u30F3\u30AF\u3067\u7D9A\u884C",
157
+ passkey: "\u30D1\u30B9\u30AD\u30FC\u3067\u30ED\u30B0\u30A4\u30F3",
158
+ securedBy: "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u63D0\u4F9B",
159
+ backToSignIn: "\u30ED\u30B0\u30A4\u30F3\u306B\u623B\u308B"
160
+ },
161
+ "zh-CN": {
162
+ welcomeBack: "\u6B22\u8FCE\u56DE\u6765",
163
+ createAccount: "\u521B\u5EFA\u8D26\u6237",
164
+ alreadyHaveAccount: "\u5DF2\u6709\u8D26\u6237\uFF1F",
165
+ dontHaveAccount: "\u6CA1\u6709\u8D26\u6237\uFF1F",
166
+ signIn: "\u767B\u5F55",
167
+ signUp: "\u6CE8\u518C",
168
+ or: "\u6216",
169
+ emailAddress: "\u90AE\u7BB1\u5730\u5740",
170
+ password: "\u5BC6\u7801",
171
+ passwordHint: "\u9700\u5305\u542B\u5927\u5199\u3001\u5C0F\u5199\u5B57\u6BCD\u548C\u6570\u5B57\uFF08\u81F3\u5C118\u4F4D\uFF09",
172
+ continueWith: "\u7EE7\u7EED\u4F7F\u7528",
173
+ connectWallet: "\u8FDE\u63A5\u94B1\u5305",
174
+ magicLink: "\u4F7F\u7528\u9B54\u6CD5\u94FE\u63A5\u7EE7\u7EED",
175
+ passkey: "\u4F7F\u7528\u901A\u884C\u5BC6\u94A5\u767B\u5F55",
176
+ securedBy: "\u5B89\u5168\u4FDD\u969C",
177
+ backToSignIn: "\u8FD4\u56DE\u767B\u5F55"
178
+ },
179
+ "zh-TW": {
180
+ welcomeBack: "\u6B61\u8FCE\u56DE\u4F86",
181
+ createAccount: "\u5EFA\u7ACB\u5E33\u6236",
182
+ alreadyHaveAccount: "\u5DF2\u6709\u5E33\u6236\uFF1F",
183
+ dontHaveAccount: "\u6C92\u6709\u5E33\u6236\uFF1F",
184
+ signIn: "\u767B\u5165",
185
+ signUp: "\u8A3B\u518A",
186
+ or: "\u6216",
187
+ emailAddress: "\u96FB\u5B50\u90F5\u4EF6",
188
+ password: "\u5BC6\u78BC",
189
+ passwordHint: "\u9700\u5305\u542B\u5927\u5BEB\u3001\u5C0F\u5BEB\u5B57\u6BCD\u548C\u6578\u5B57\uFF08\u81F3\u5C118\u4F4D\uFF09",
190
+ continueWith: "\u7E7C\u7E8C\u4F7F\u7528",
191
+ connectWallet: "\u9023\u63A5\u9322\u5305",
192
+ magicLink: "\u4F7F\u7528\u9B54\u6CD5\u9023\u7D50\u7E7C\u7E8C",
193
+ passkey: "\u4F7F\u7528\u901A\u884C\u91D1\u9470\u767B\u5165",
194
+ securedBy: "\u5B89\u5168\u4FDD\u969C",
195
+ backToSignIn: "\u8FD4\u56DE\u767B\u5165"
196
+ },
197
+ "pt-BR": {
198
+ welcomeBack: "Bem-vindo de volta",
199
+ createAccount: "Crie sua conta",
200
+ alreadyHaveAccount: "Ja tem uma conta?",
201
+ dontHaveAccount: "Nao tem uma conta?",
202
+ signIn: "Entrar",
203
+ signUp: "Cadastrar",
204
+ or: "ou",
205
+ emailAddress: "Endereco de e-mail",
206
+ password: "Senha",
207
+ passwordHint: "Deve conter maiusculas, minusculas e numeros (min 8 caracteres)",
208
+ continueWith: "Continuar com",
209
+ connectWallet: "Conectar carteira",
210
+ magicLink: "Continuar com Magic Link",
211
+ passkey: "Entrar com Passkey",
212
+ securedBy: "Protegido por",
213
+ backToSignIn: "Voltar ao login"
214
+ },
215
+ es: {
216
+ welcomeBack: "Bienvenido de nuevo",
217
+ createAccount: "Crea tu cuenta",
218
+ alreadyHaveAccount: "Ya tienes una cuenta?",
219
+ dontHaveAccount: "No tienes una cuenta?",
220
+ signIn: "Iniciar sesion",
221
+ signUp: "Registrarse",
222
+ or: "o",
223
+ emailAddress: "Correo electronico",
224
+ password: "Contrasena",
225
+ passwordHint: "Debe contener mayusculas, minusculas y numeros (min 8 caracteres)",
226
+ continueWith: "Continuar con",
227
+ connectWallet: "Conectar billetera",
228
+ magicLink: "Continuar con Magic Link",
229
+ passkey: "Iniciar con Passkey",
230
+ securedBy: "Protegido por",
231
+ backToSignIn: "Volver al inicio de sesion"
232
+ },
233
+ de: {
234
+ welcomeBack: "Willkommen zuruck",
235
+ createAccount: "Konto erstellen",
236
+ alreadyHaveAccount: "Bereits ein Konto?",
237
+ dontHaveAccount: "Noch kein Konto?",
238
+ signIn: "Anmelden",
239
+ signUp: "Registrieren",
240
+ or: "oder",
241
+ emailAddress: "E-Mail-Adresse",
242
+ password: "Passwort",
243
+ passwordHint: "Gross-/Kleinbuchstaben und Zahl erforderlich (mind. 8 Zeichen)",
244
+ continueWith: "Weiter mit",
245
+ connectWallet: "Wallet verbinden",
246
+ magicLink: "Weiter mit Magic Link",
247
+ passkey: "Mit Passkey anmelden",
248
+ securedBy: "Gesichert durch",
249
+ backToSignIn: "Zuruck zur Anmeldung"
250
+ },
251
+ fr: {
252
+ welcomeBack: "Bon retour",
253
+ createAccount: "Creez votre compte",
254
+ alreadyHaveAccount: "Vous avez deja un compte ?",
255
+ dontHaveAccount: "Vous n'avez pas de compte ?",
256
+ signIn: "Se connecter",
257
+ signUp: "S'inscrire",
258
+ or: "ou",
259
+ emailAddress: "Adresse e-mail",
260
+ password: "Mot de passe",
261
+ passwordHint: "Doit contenir majuscules, minuscules et chiffres (min 8 caracteres)",
262
+ continueWith: "Continuer avec",
263
+ connectWallet: "Connecter le portefeuille",
264
+ magicLink: "Continuer avec Magic Link",
265
+ passkey: "Se connecter avec Passkey",
266
+ securedBy: "Securise par",
267
+ backToSignIn: "Retour a la connexion"
268
+ },
269
+ hi: {
270
+ welcomeBack: "\u0935\u093E\u092A\u0938\u0940 \u092A\u0930 \u0938\u094D\u0935\u093E\u0917\u0924 \u0939\u0948",
271
+ createAccount: "\u0905\u092A\u0928\u093E \u0916\u093E\u0924\u093E \u092C\u0928\u093E\u090F\u0902",
272
+ alreadyHaveAccount: "\u092A\u0939\u0932\u0947 \u0938\u0947 \u0916\u093E\u0924\u093E \u0939\u0948?",
273
+ dontHaveAccount: "\u0916\u093E\u0924\u093E \u0928\u0939\u0940\u0902 \u0939\u0948?",
274
+ signIn: "\u0938\u093E\u0907\u0928 \u0907\u0928",
275
+ signUp: "\u0938\u093E\u0907\u0928 \u0905\u092A",
276
+ or: "\u092F\u093E",
277
+ emailAddress: "\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",
278
+ password: "\u092A\u093E\u0938\u0935\u0930\u094D\u0921",
279
+ passwordHint: "\u092C\u0921\u093C\u0947, \u091B\u094B\u091F\u0947 \u0905\u0915\u094D\u0937\u0930 \u0914\u0930 \u0938\u0902\u0916\u094D\u092F\u093E \u0906\u0935\u0936\u094D\u092F\u0915 (\u0915\u092E \u0938\u0947 \u0915\u092E 8 \u0905\u0915\u094D\u0937\u0930)",
280
+ continueWith: "\u0938\u0947 \u091C\u093E\u0930\u0940 \u0930\u0916\u0947\u0902",
281
+ connectWallet: "\u0935\u0949\u0932\u0947\u091F \u0915\u0928\u0947\u0915\u094D\u091F \u0915\u0930\u0947\u0902",
282
+ magicLink: "\u092E\u0948\u091C\u093F\u0915 \u0932\u093F\u0902\u0915 \u0938\u0947 \u091C\u093E\u0930\u0940 \u0930\u0916\u0947\u0902",
283
+ passkey: "\u092A\u093E\u0938\u0915\u0940 \u0938\u0947 \u0938\u093E\u0907\u0928 \u0907\u0928",
284
+ securedBy: "\u0938\u0941\u0930\u0915\u094D\u0937\u093E \u092A\u094D\u0930\u0926\u093E\u0924\u093E",
285
+ backToSignIn: "\u0938\u093E\u0907\u0928 \u0907\u0928 \u092A\u0930 \u0935\u093E\u092A\u0938 \u091C\u093E\u090F\u0902"
286
+ },
287
+ tr: {
288
+ welcomeBack: "Tekrar hos geldiniz",
289
+ createAccount: "Hesap olusturun",
290
+ alreadyHaveAccount: "Zaten bir hesabiniz var mi?",
291
+ dontHaveAccount: "Hesabiniz yok mu?",
292
+ signIn: "Giris yap",
293
+ signUp: "Kaydol",
294
+ or: "veya",
295
+ emailAddress: "E-posta adresi",
296
+ password: "Sifre",
297
+ passwordHint: "Buyuk, kucuk harf ve rakam icermeli (en az 8 karakter)",
298
+ continueWith: "ile devam et",
299
+ connectWallet: "Cuzdan bagla",
300
+ magicLink: "Magic Link ile devam et",
301
+ passkey: "Passkey ile giris yap",
302
+ securedBy: "Guvenlik saglayici",
303
+ backToSignIn: "Girise don"
304
+ },
305
+ id: {
306
+ welcomeBack: "Selamat datang kembali",
307
+ createAccount: "Buat akun Anda",
308
+ alreadyHaveAccount: "Sudah punya akun?",
309
+ dontHaveAccount: "Belum punya akun?",
310
+ signIn: "Masuk",
311
+ signUp: "Daftar",
312
+ or: "atau",
313
+ emailAddress: "Alamat email",
314
+ password: "Kata sandi",
315
+ passwordHint: "Harus mengandung huruf besar, kecil, dan angka (min 8 karakter)",
316
+ continueWith: "Lanjutkan dengan",
317
+ connectWallet: "Hubungkan dompet",
318
+ magicLink: "Lanjutkan dengan Magic Link",
319
+ passkey: "Masuk dengan Passkey",
320
+ securedBy: "Diamankan oleh",
321
+ backToSignIn: "Kembali ke login"
322
+ },
323
+ vi: {
324
+ welcomeBack: "Chao mung tro lai",
325
+ createAccount: "Tao tai khoan",
326
+ alreadyHaveAccount: "Da co tai khoan?",
327
+ dontHaveAccount: "Chua co tai khoan?",
328
+ signIn: "Dang nhap",
329
+ signUp: "Dang ky",
330
+ or: "hoac",
331
+ emailAddress: "Dia chi email",
332
+ password: "Mat khau",
333
+ passwordHint: "Can chu hoa, chu thuong va so (toi thieu 8 ky tu)",
334
+ continueWith: "Tiep tuc voi",
335
+ connectWallet: "Ket noi vi",
336
+ magicLink: "Tiep tuc voi Magic Link",
337
+ passkey: "Dang nhap voi Passkey",
338
+ securedBy: "Bao mat boi",
339
+ backToSignIn: "Quay lai dang nhap"
340
+ },
341
+ th: {
342
+ welcomeBack: "\u0E22\u0E34\u0E19\u0E14\u0E35\u0E15\u0E49\u0E2D\u0E19\u0E23\u0E31\u0E1A\u0E01\u0E25\u0E31\u0E1A",
343
+ createAccount: "\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E1A\u0E31\u0E0D\u0E0A\u0E35",
344
+ alreadyHaveAccount: "\u0E21\u0E35\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E2D\u0E22\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27?",
345
+ dontHaveAccount: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E1A\u0E31\u0E0D\u0E0A\u0E35?",
346
+ signIn: "\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A",
347
+ signUp: "\u0E2A\u0E21\u0E31\u0E04\u0E23\u0E2A\u0E21\u0E32\u0E0A\u0E34\u0E01",
348
+ or: "\u0E2B\u0E23\u0E37\u0E2D",
349
+ emailAddress: "\u0E2D\u0E35\u0E40\u0E21\u0E25",
350
+ password: "\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",
351
+ passwordHint: "\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E15\u0E31\u0E27\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E43\u0E2B\u0E0D\u0E48 \u0E15\u0E31\u0E27\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E25\u0E47\u0E01 \u0E41\u0E25\u0E30\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 8 \u0E15\u0E31\u0E27)",
352
+ continueWith: "\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E15\u0E48\u0E2D\u0E14\u0E49\u0E27\u0E22",
353
+ connectWallet: "\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E01\u0E23\u0E30\u0E40\u0E1B\u0E4B\u0E32",
354
+ magicLink: "\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E15\u0E48\u0E2D\u0E14\u0E49\u0E27\u0E22 Magic Link",
355
+ passkey: "\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A\u0E14\u0E49\u0E27\u0E22 Passkey",
356
+ securedBy: "\u0E23\u0E31\u0E01\u0E29\u0E32\u0E04\u0E27\u0E32\u0E21\u0E1B\u0E25\u0E2D\u0E14\u0E20\u0E31\u0E22\u0E42\u0E14\u0E22",
357
+ backToSignIn: "\u0E01\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A"
358
+ },
359
+ ru: {
360
+ welcomeBack: "\u0421 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0435\u043D\u0438\u0435\u043C",
361
+ createAccount: "\u0421\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u0430\u043A\u043A\u0430\u0443\u043D\u0442",
362
+ alreadyHaveAccount: "\u0423\u0436\u0435 \u0435\u0441\u0442\u044C \u0430\u043A\u043A\u0430\u0443\u043D\u0442?",
363
+ dontHaveAccount: "\u041D\u0435\u0442 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430?",
364
+ signIn: "\u0412\u043E\u0439\u0442\u0438",
365
+ signUp: "\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F",
366
+ or: "\u0438\u043B\u0438",
367
+ emailAddress: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430",
368
+ password: "\u041F\u0430\u0440\u043E\u043B\u044C",
369
+ passwordHint: "\u0417\u0430\u0433\u043B\u0430\u0432\u043D\u044B\u0435, \u0441\u0442\u0440\u043E\u0447\u043D\u044B\u0435 \u0431\u0443\u043A\u0432\u044B \u0438 \u0446\u0438\u0444\u0440\u044B (\u043C\u0438\u043D. 8 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)",
370
+ continueWith: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0441",
371
+ connectWallet: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043A\u043E\u0448\u0435\u043B\u0435\u043A",
372
+ magicLink: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0441 Magic Link",
373
+ passkey: "\u0412\u043E\u0439\u0442\u0438 \u0441 Passkey",
374
+ securedBy: "\u0417\u0430\u0449\u0438\u0449\u0435\u043D\u043E",
375
+ backToSignIn: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043A \u0432\u0445\u043E\u0434\u0443"
376
+ },
377
+ it: {
378
+ welcomeBack: "Bentornato",
379
+ createAccount: "Crea il tuo account",
380
+ alreadyHaveAccount: "Hai gia un account?",
381
+ dontHaveAccount: "Non hai un account?",
382
+ signIn: "Accedi",
383
+ signUp: "Registrati",
384
+ or: "o",
385
+ emailAddress: "Indirizzo email",
386
+ password: "Password",
387
+ passwordHint: "Deve contenere maiuscole, minuscole e numeri (min 8 caratteri)",
388
+ continueWith: "Continua con",
389
+ connectWallet: "Connetti portafoglio",
390
+ magicLink: "Continua con Magic Link",
391
+ passkey: "Accedi con Passkey",
392
+ securedBy: "Protetto da",
393
+ backToSignIn: "Torna all'accesso"
394
+ },
395
+ pl: {
396
+ welcomeBack: "Witaj ponownie",
397
+ createAccount: "Utworz konto",
398
+ alreadyHaveAccount: "Masz juz konto?",
399
+ dontHaveAccount: "Nie masz konta?",
400
+ signIn: "Zaloguj sie",
401
+ signUp: "Zarejestruj sie",
402
+ or: "lub",
403
+ emailAddress: "Adres e-mail",
404
+ password: "Haslo",
405
+ passwordHint: "Wielkie, male litery i cyfry (min 8 znakow)",
406
+ continueWith: "Kontynuuj z",
407
+ connectWallet: "Polacz portfel",
408
+ magicLink: "Kontynuuj z Magic Link",
409
+ passkey: "Zaloguj sie z Passkey",
410
+ securedBy: "Zabezpieczone przez",
411
+ backToSignIn: "Powrot do logowania"
412
+ },
413
+ nl: {
414
+ welcomeBack: "Welkom terug",
415
+ createAccount: "Maak je account aan",
416
+ alreadyHaveAccount: "Heb je al een account?",
417
+ dontHaveAccount: "Nog geen account?",
418
+ signIn: "Inloggen",
419
+ signUp: "Registreren",
420
+ or: "of",
421
+ emailAddress: "E-mailadres",
422
+ password: "Wachtwoord",
423
+ passwordHint: "Hoofdletters, kleine letters en cijfers vereist (min 8 tekens)",
424
+ continueWith: "Doorgaan met",
425
+ connectWallet: "Portemonnee verbinden",
426
+ magicLink: "Doorgaan met Magic Link",
427
+ passkey: "Inloggen met Passkey",
428
+ securedBy: "Beveiligd door",
429
+ backToSignIn: "Terug naar inloggen"
430
+ },
431
+ ar: {
432
+ welcomeBack: "\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643",
433
+ createAccount: "\u0623\u0646\u0634\u0626 \u062D\u0633\u0627\u0628\u0643",
434
+ alreadyHaveAccount: "\u0644\u062F\u064A\u0643 \u062D\u0633\u0627\u0628 \u0628\u0627\u0644\u0641\u0639\u0644\u061F",
435
+ dontHaveAccount: "\u0644\u064A\u0633 \u0644\u062F\u064A\u0643 \u062D\u0633\u0627\u0628\u061F",
436
+ signIn: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",
437
+ signUp: "\u0625\u0646\u0634\u0627\u0621 \u062D\u0633\u0627\u0628",
438
+ or: "\u0623\u0648",
439
+ emailAddress: "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",
440
+ password: "\u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631",
441
+ passwordHint: "\u064A\u062C\u0628 \u0623\u0646 \u062A\u062D\u062A\u0648\u064A \u0639\u0644\u0649 \u0623\u062D\u0631\u0641 \u0643\u0628\u064A\u0631\u0629 \u0648\u0635\u063A\u064A\u0631\u0629 \u0648\u0623\u0631\u0642\u0627\u0645 (8 \u0623\u062D\u0631\u0641 \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644)",
442
+ continueWith: "\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0628\u0627\u0633\u062A\u062E\u062F\u0627\u0645",
443
+ connectWallet: "\u0631\u0628\u0637 \u0627\u0644\u0645\u062D\u0641\u0638\u0629",
444
+ magicLink: "\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0628\u0627\u0633\u062A\u062E\u062F\u0627\u0645 Magic Link",
445
+ passkey: "\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0627\u0633\u062A\u062E\u062F\u0627\u0645 Passkey",
446
+ securedBy: "\u0645\u062D\u0645\u064A \u0628\u0648\u0627\u0633\u0637\u0629",
447
+ backToSignIn: "\u0627\u0644\u0639\u0648\u062F\u0629 \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644"
448
+ },
449
+ sv: {
450
+ welcomeBack: "Valkommen tillbaka",
451
+ createAccount: "Skapa ditt konto",
452
+ alreadyHaveAccount: "Har du redan ett konto?",
453
+ dontHaveAccount: "Har du inget konto?",
454
+ signIn: "Logga in",
455
+ signUp: "Registrera dig",
456
+ or: "eller",
457
+ emailAddress: "E-postadress",
458
+ password: "Losenord",
459
+ passwordHint: "Stora, sma bokstaver och siffror kravs (minst 8 tecken)",
460
+ continueWith: "Fortsatt med",
461
+ connectWallet: "Anslut planbok",
462
+ magicLink: "Fortsatt med Magic Link",
463
+ passkey: "Logga in med Passkey",
464
+ securedBy: "Sakrad av",
465
+ backToSignIn: "Tillbaka till inloggning"
466
+ },
467
+ uk: {
468
+ welcomeBack: "\u0417 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F\u043C",
469
+ createAccount: "\u0421\u0442\u0432\u043E\u0440\u0456\u0442\u044C \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u0438\u0439 \u0437\u0430\u043F\u0438\u0441",
470
+ alreadyHaveAccount: "\u0412\u0436\u0435 \u0454 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u0438\u0439 \u0437\u0430\u043F\u0438\u0441?",
471
+ dontHaveAccount: "\u041D\u0435\u043C\u0430\u0454 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u043E\u0433\u043E \u0437\u0430\u043F\u0438\u0441\u0443?",
472
+ signIn: "\u0423\u0432\u0456\u0439\u0442\u0438",
473
+ signUp: "\u0417\u0430\u0440\u0435\u0454\u0441\u0442\u0440\u0443\u0432\u0430\u0442\u0438\u0441\u044F",
474
+ or: "\u0430\u0431\u043E",
475
+ emailAddress: "\u0415\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430 \u043F\u043E\u0448\u0442\u0430",
476
+ password: "\u041F\u0430\u0440\u043E\u043B\u044C",
477
+ passwordHint: "\u0412\u0435\u043B\u0438\u043A\u0456, \u043C\u0430\u043B\u0456 \u043B\u0456\u0442\u0435\u0440\u0438 \u0442\u0430 \u0446\u0438\u0444\u0440\u0438 (\u043C\u0456\u043D. 8 \u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432)",
478
+ continueWith: "\u041F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0437",
479
+ connectWallet: "\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438 \u0433\u0430\u043C\u0430\u043D\u0435\u0446\u044C",
480
+ magicLink: "\u041F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u0437 Magic Link",
481
+ passkey: "\u0423\u0432\u0456\u0439\u0442\u0438 \u0437 Passkey",
482
+ securedBy: "\u0417\u0430\u0445\u0438\u0449\u0435\u043D\u043E",
483
+ backToSignIn: "\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438\u0441\u044F \u0434\u043E \u0432\u0445\u043E\u0434\u0443"
484
+ }
485
+ };
486
+ function getStrings(locale) {
487
+ if (locale in translations) return translations[locale];
488
+ const lang = locale.split("-")[0].split("_")[0];
489
+ if (lang in translations) return translations[lang];
490
+ return translations.en;
491
+ }
492
+
103
493
  // src/modal.ts
104
494
  function hexToRgba(hex, alpha) {
105
495
  const h = hex.replace("#", "");
@@ -155,6 +545,8 @@ var ModalRenderer = class {
155
545
  turnstileWidgetId = null;
156
546
  turnstileToken = "";
157
547
  turnstileWrapper = null;
548
+ // i18n
549
+ t;
158
550
  // Dev Teleport (test mode)
159
551
  isTestMode = false;
160
552
  onDevTeleport = null;
@@ -164,6 +556,7 @@ var ModalRenderer = class {
164
556
  this.branding = { ...DEFAULT_BRANDING, ...options.branding };
165
557
  this.captchaSiteKey = options.captchaSiteKey || "";
166
558
  this.isTestMode = options.isTestMode || false;
559
+ this.t = getStrings(options.locale || "en");
167
560
  this.onDevTeleport = options.onDevTeleport || null;
168
561
  this.onProviderClick = options.onProviderClick;
169
562
  this.onEmailSubmit = options.onEmailSubmit;
@@ -435,9 +828,9 @@ var ModalRenderer = class {
435
828
  buildInnerContent(view) {
436
829
  const b = this.branding;
437
830
  const isSignUp = view === "signUp";
438
- const title = isSignUp ? "Create your account" : "Welcome back";
439
- const subtitle = isSignUp ? "Already have an account?" : "Don't have an account?";
440
- const subtitleLink = isSignUp ? "Sign in" : "Sign up";
831
+ const title = isSignUp ? this.t.createAccount : this.t.welcomeBack;
832
+ const subtitle = isSignUp ? this.t.alreadyHaveAccount : this.t.dontHaveAccount;
833
+ const subtitleLink = isSignUp ? this.t.signIn : this.t.signUp;
441
834
  const dark = this.isDark();
442
835
  const showProviders = !isSignUp;
443
836
  const providerButtons = showProviders ? this.enabledProviders.filter((p) => !b.hiddenProviders?.includes(p)).map((p) => {
@@ -450,12 +843,13 @@ var ModalRenderer = class {
450
843
  <span>${config.label}</span>
451
844
  </button>`;
452
845
  }).join("") : "";
453
- const divider = showProviders && b.showDivider !== false && b.showEmailPassword !== false ? `<div class="divider"><span>or</span></div>` : "";
846
+ const hasVisibleProviders = showProviders && this.enabledProviders.filter((p) => !b.hiddenProviders?.includes(p)).length > 0;
847
+ const divider = hasVisibleProviders && b.showDivider !== false && b.showEmailPassword !== false ? `<div class="divider"><span>${this.t.or}</span></div>` : "";
454
848
  const emailForm = b.showEmailPassword !== false ? `<form class="email-form" id="email-form">
455
- <input type="email" placeholder="Email address" name="email" required class="input" autocomplete="email" />
456
- <input type="password" placeholder="Password" name="password" required class="input" autocomplete="${isSignUp ? "new-password" : "current-password"}" />
457
- ${isSignUp ? '<p class="password-hint">Must contain uppercase, lowercase, and a number (min 8 chars)</p>' : ""}
458
- <button type="submit" class="submit-btn">${isSignUp ? "Sign up" : "Sign in"}</button>
849
+ <input type="email" placeholder="${this.t.emailAddress}" name="email" required class="input" autocomplete="email" />
850
+ <input type="password" placeholder="${this.t.password}" name="password" required class="input" autocomplete="${isSignUp ? "new-password" : "current-password"}" />
851
+ ${isSignUp ? `<p class="password-hint">${this.t.passwordHint}</p>` : ""}
852
+ <button type="submit" class="submit-btn">${isSignUp ? this.t.signUp : this.t.signIn}</button>
459
853
  </form>` : "";
460
854
  const hasMethodAbove = showProviders && this.enabledProviders.length > 0 || b.showEmailPassword !== false;
461
855
  const hasMethodBelow = b.showWeb3 || b.showPasswordless || b.showPasskey;
@@ -466,7 +860,7 @@ var ModalRenderer = class {
466
860
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
467
861
  <path d="M21 12V7H5a2 2 0 0 1 0-4h14v4"/><path d="M3 5v14a2 2 0 0 0 2 2h16v-5"/><path d="M18 12a2 2 0 0 0 0 4h4v-4h-4z"/>
468
862
  </svg>
469
- <span>Connect Wallet</span>
863
+ <span>${this.t.connectWallet}</span>
470
864
  </button>`);
471
865
  }
472
866
  if (b.showPasswordless) {
@@ -474,7 +868,7 @@ var ModalRenderer = class {
474
868
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
475
869
  <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>
476
870
  </svg>
477
- <span>Continue with Magic Link</span>
871
+ <span>${this.t.magicLink}</span>
478
872
  </button>`);
479
873
  }
480
874
  if (b.showPasskey) {
@@ -482,7 +876,7 @@ var ModalRenderer = class {
482
876
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
483
877
  <circle cx="10" cy="7" r="4"/><path d="M10.3 15H7a4 4 0 0 0-4 4v2"/><path d="M21.7 13.3 19 11"/><path d="m21 15-2.5-1.5"/><path d="m17 17 2.5-1.5"/><path d="M22 9v6a1 1 0 0 1-1 1h-.5"/><circle cx="18" cy="9" r="3"/>
484
878
  </svg>
485
- <span>Sign in with Passkey</span>
879
+ <span>${this.t.passkey}</span>
486
880
  </button>`);
487
881
  }
488
882
  const authMethods = methodButtons.length > 0 ? `<div class="auth-methods">${methodButtons.join("")}</div>` : "";
@@ -518,7 +912,7 @@ var ModalRenderer = class {
518
912
  <button type="button" id="dev-teleport-btn" class="dev-teleport-btn">Go</button>
519
913
  </div>
520
914
  </div>` : ""}
521
- ${b.showSecuredBy !== false ? `<div class="secured-by">Secured by <a href="https://authon.dev" target="_blank" rel="noopener noreferrer" class="secured-link">Authon</a></div>` : ""}
915
+ ${b.showSecuredBy !== false ? `<div class="secured-by">${this.t.securedBy} <a href="https://authon.dev" target="_blank" rel="noopener noreferrer" class="secured-link">Authon</a></div>` : ""}
522
916
  `;
523
917
  }
524
918
  renderTurnstile() {
@@ -2133,6 +2527,7 @@ var Authon = class {
2133
2527
  this.modal = new ModalRenderer({
2134
2528
  mode: this.config.mode,
2135
2529
  theme: this.config.theme,
2530
+ locale: this.config.locale,
2136
2531
  containerId: this.config.containerId,
2137
2532
  branding: this.branding || void 0,
2138
2533
  captchaSiteKey: this.captchaEnabled ? this.turnstileSiteKey : void 0,
@@ -2591,6 +2986,8 @@ var Authon = class {
2591
2986
  Authon,
2592
2987
  AuthonMfaRequiredError,
2593
2988
  generateQrSvg,
2594
- getProviderButtonConfig
2989
+ getProviderButtonConfig,
2990
+ getStrings,
2991
+ translations
2595
2992
  });
2596
2993
  //# sourceMappingURL=index.cjs.map