@authon/js 0.4.1 → 0.4.2

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
@@ -450,7 +450,8 @@ var ModalRenderer = class {
450
450
  <span>${config.label}</span>
451
451
  </button>`;
452
452
  }).join("") : "";
453
- const divider = showProviders && b.showDivider !== false && b.showEmailPassword !== false ? `<div class="divider"><span>or</span></div>` : "";
453
+ const hasVisibleProviders = showProviders && this.enabledProviders.filter((p) => !b.hiddenProviders?.includes(p)).length > 0;
454
+ const divider = hasVisibleProviders && b.showDivider !== false && b.showEmailPassword !== false ? `<div class="divider"><span>or</span></div>` : "";
454
455
  const emailForm = b.showEmailPassword !== false ? `<form class="email-form" id="email-form">
455
456
  <input type="email" placeholder="Email address" name="email" required class="input" autocomplete="email" />
456
457
  <input type="password" placeholder="Password" name="password" required class="input" autocomplete="${isSignUp ? "new-password" : "current-password"}" />