isa-auth 0.2.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isa-auth",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Unified, framework-agnostic frontend authentication library supporting OAuth (Google, Apple, Meta, Line, Kakao, Naver), Developer (GitHub, Discord), Web3 (SIWE), Identity (World ID Orb, Passkey WebAuthn), reactive store, and RBAC guards with AI Agent skills",
5
5
  "keywords": [
6
6
  "auth",
@@ -58,7 +58,8 @@
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsup",
61
- "dev": "tsup --watch"
61
+ "dev": "tsup --watch",
62
+ "test": "node ../../tests/integration.test.js"
62
63
  },
63
64
  "bugs": {
64
65
  "url": "https://github.com/yoonjonglyu/isa-auth/issues"
@@ -25,6 +25,38 @@ This skill provides full reference, architecture details, and copy-paste recipes
25
25
 
26
26
  ## 🚀 2. Code Recipes
27
27
 
28
+ ### Recipe 0: Multi-Provider All-in-One Configuration (Recommended)
29
+ ```typescript
30
+ import { IsaAuth } from 'isa-auth';
31
+
32
+ // 1. Initialize multiple providers simultaneously
33
+ const auth = new IsaAuth({
34
+ storage: 'memory', // Production security default
35
+ providers: {
36
+ google: { clientId: 'GOOGLE_CLIENT_ID', callbackUrl: 'https://myapp.com/callback' },
37
+ kakao: { clientId: 'KAKAO_JAVASCRIPT_KEY', callbackUrl: 'https://myapp.com/callback' },
38
+ apple: { clientId: 'com.myapp.service', callbackUrl: 'https://myapp.com/callback' },
39
+ github: { clientId: 'GITHUB_CLIENT_ID', callbackUrl: 'https://myapp.com/callback' },
40
+ passkey: { rpName: 'My Enterprise App', rpId: 'myapp.com' },
41
+ },
42
+ });
43
+
44
+ // 2. Trigger individual provider login
45
+ await auth.signIn('kakao');
46
+ // or
47
+ await auth.signIn('google');
48
+
49
+ // 3. Render buttons: individual or all at once
50
+ auth.renderButton('github', document.getElementById('gh-slot'));
51
+ auth.renderAllButtons(document.getElementById('social-login-grid'), {
52
+ direction: 'grid', // 'grid' | 'column' | 'row'
53
+ gap: '12px',
54
+ });
55
+
56
+ // 4. Query registered providers
57
+ console.log(auth.getRegisteredProviders()); // ['google', 'kakao', 'apple', 'github', 'passkey']
58
+ ```
59
+
28
60
  ### Recipe A: World ID (World Network / Orb Verification)
29
61
  ```typescript
30
62
  import { IsaAuth } from 'isa-auth';