isa-auth 0.2.1 → 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/README.md +9 -0
- package/dist/index.d.mts +49 -5
- package/dist/index.d.ts +49 -5
- package/dist/index.js +7203 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7202 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
> **A Unified, Framework-Agnostic Frontend Authentication Suite**
|
|
4
4
|
> Supporting Multi-Provider OAuth (Google, Apple, Meta, Line, Kakao, Naver), Developer (GitHub, Discord), Web3 (SIWE), Identity (World ID Orb, Passkey WebAuthn), Reactive Store, Axios/Fetch Interceptors, and RBAC/ABAC Guards.
|
|
5
5
|
|
|
6
|
+
[](https://yoonjonglyu.github.io/isa-auth/)
|
|
7
|
+
[](https://www.npmjs.com/package/isa-auth)
|
|
6
8
|
[](https://opensource.org/licenses/MIT)
|
|
7
9
|
[](https://www.typescriptlang.org/)
|
|
8
10
|
[](https://swc.rs/)
|
|
@@ -10,6 +12,11 @@
|
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
15
|
+
> 🎮 **Try the Live Interactive Demo**: [https://yoonjonglyu.github.io/isa-auth/](https://yoonjonglyu.github.io/isa-auth/)
|
|
16
|
+
> Experience 11 authentication providers, real-time reactive store visualization, dynamic button layouts, and wildcard RBAC guard checks directly in your browser without any setup!
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
13
20
|
## 🌟 Why ISA AUTH?
|
|
14
21
|
|
|
15
22
|
Modern web applications frequently require diverse authentication methods — from global platforms (Google, Apple, Meta) and local portals (Kakao, Naver, Line) to developer communities (GitHub, Discord), decentralized Web3 wallets (SIWE), and next-generation biometric/identity systems (**World ID Orb & Passkey**).
|
|
@@ -74,6 +81,8 @@ pnpm add isa-auth
|
|
|
74
81
|
|
|
75
82
|
## 🚀 Quick Start Recipes
|
|
76
83
|
|
|
84
|
+
> 💡 **Developer Keys Setup**: Need help obtaining Client IDs, API Keys or configuring Redirect URIs? Check out our complete [Provider Environment Setup Guide](../../docs/ENV_SETUP.md).
|
|
85
|
+
|
|
77
86
|
### 1. Multi-Provider All-in-One Configuration (Recommended)
|
|
78
87
|
|
|
79
88
|
Manage multiple social logins, developer platforms, and Web3/Passkey authentication simultaneously in a single application instance:
|
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ interface LoginButtonConfig {
|
|
|
5
5
|
style?: Partial<CSSStyleDeclaration>;
|
|
6
6
|
text?: string;
|
|
7
7
|
icon?: string;
|
|
8
|
+
svg?: string;
|
|
8
9
|
fullWidth?: boolean;
|
|
9
10
|
}
|
|
10
11
|
interface LoginButtonProps {
|
|
@@ -20,6 +21,7 @@ declare class LoginButton {
|
|
|
20
21
|
readonly config: LoginButtonConfig;
|
|
21
22
|
constructor(props: LoginButtonProps);
|
|
22
23
|
private getDefaultText;
|
|
24
|
+
private getProviderBrandStyle;
|
|
23
25
|
private getDefaultStyle;
|
|
24
26
|
private mergeStyles;
|
|
25
27
|
getButtonClass(): string;
|
|
@@ -27,7 +29,8 @@ declare class LoginButton {
|
|
|
27
29
|
id: string;
|
|
28
30
|
type: AuthButtonType;
|
|
29
31
|
provider: ButtonProviderType;
|
|
30
|
-
|
|
32
|
+
svg: string;
|
|
33
|
+
icon: string | undefined;
|
|
31
34
|
text: string;
|
|
32
35
|
style: Partial<CSSStyleDeclaration>;
|
|
33
36
|
fullWidth: boolean;
|
|
@@ -1164,10 +1167,11 @@ interface ButtonRenderInfo {
|
|
|
1164
1167
|
label?: string;
|
|
1165
1168
|
className?: string;
|
|
1166
1169
|
icon?: string;
|
|
1170
|
+
svg?: string;
|
|
1167
1171
|
style?: Partial<CSSStyleDeclaration>;
|
|
1168
1172
|
}
|
|
1169
1173
|
/**
|
|
1170
|
-
* Creates and returns a native HTMLButtonElement
|
|
1174
|
+
* Creates and returns a native HTMLButtonElement with vector icons & micro-animations
|
|
1171
1175
|
*/
|
|
1172
1176
|
declare function renderByJs(info: ButtonRenderInfo): HTMLButtonElement;
|
|
1173
1177
|
/**
|
|
@@ -1713,16 +1717,56 @@ declare function renderByVue(info: ButtonRenderInfo): {
|
|
|
1713
1717
|
* Registers custom Web Component <isa-auth-button>
|
|
1714
1718
|
*/
|
|
1715
1719
|
declare function registerWebComponent(): void;
|
|
1720
|
+
/**
|
|
1721
|
+
* TypeScript JSX IntrinsicElements Declaration for Web Component <isa-auth-button>
|
|
1722
|
+
* Eliminates "Property 'isa-auth-button' does not exist on type 'JSX.IntrinsicElements'" in React/Vue/TSX
|
|
1723
|
+
*/
|
|
1724
|
+
interface IsaAuthButtonAttributes {
|
|
1725
|
+
provider?: string;
|
|
1726
|
+
label?: string;
|
|
1727
|
+
class?: string;
|
|
1728
|
+
style?: string;
|
|
1729
|
+
'onisa-auth-click'?: (event: CustomEvent) => void;
|
|
1730
|
+
children?: any;
|
|
1731
|
+
}
|
|
1732
|
+
declare global {
|
|
1733
|
+
namespace JSX {
|
|
1734
|
+
interface IntrinsicElements {
|
|
1735
|
+
'isa-auth-button': IsaAuthButtonAttributes;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1716
1739
|
|
|
1717
1740
|
type index_ButtonRenderInfo = ButtonRenderInfo;
|
|
1741
|
+
type index_IsaAuthButtonAttributes = IsaAuthButtonAttributes;
|
|
1718
1742
|
declare const index_registerWebComponent: typeof registerWebComponent;
|
|
1719
1743
|
declare const index_renderByJs: typeof renderByJs;
|
|
1720
1744
|
declare const index_renderByReact: typeof renderByReact;
|
|
1721
1745
|
declare const index_renderByVue: typeof renderByVue;
|
|
1722
1746
|
declare namespace index {
|
|
1723
|
-
export { type index_ButtonRenderInfo as ButtonRenderInfo, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1747
|
+
export { type index_ButtonRenderInfo as ButtonRenderInfo, type index_IsaAuthButtonAttributes as IsaAuthButtonAttributes, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1724
1748
|
}
|
|
1725
1749
|
|
|
1750
|
+
/**
|
|
1751
|
+
* React Type-Safe Wrapper Component for ISA-AUTH Buttons
|
|
1752
|
+
* Provides 100% TypeScript Props & Event IntelliSense
|
|
1753
|
+
*/
|
|
1754
|
+
|
|
1755
|
+
interface IsaAuthButtonProps {
|
|
1756
|
+
auth?: IsaAuth;
|
|
1757
|
+
provider: CoreProviderType;
|
|
1758
|
+
label?: string;
|
|
1759
|
+
className?: string;
|
|
1760
|
+
style?: Record<string, string | number>;
|
|
1761
|
+
onSuccess?: (user: any) => void;
|
|
1762
|
+
onError?: (error: any) => void;
|
|
1763
|
+
children?: any;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Creates a strongly typed React Component from an IsaAuth instance
|
|
1767
|
+
*/
|
|
1768
|
+
declare function createReactAuthButton(authInstance: IsaAuth): (props: IsaAuthButtonProps) => any;
|
|
1769
|
+
|
|
1726
1770
|
interface ProviderOptionConfig {
|
|
1727
1771
|
clientId?: string;
|
|
1728
1772
|
callbackUrl?: string;
|
|
@@ -1757,7 +1801,7 @@ declare class IsaAuth {
|
|
|
1757
1801
|
private instantiateProvider;
|
|
1758
1802
|
isAuthenticated(): boolean;
|
|
1759
1803
|
getAccessToken(): string | null;
|
|
1760
|
-
getUserInfo():
|
|
1804
|
+
getUserInfo(): any;
|
|
1761
1805
|
getContext(): AuthContext;
|
|
1762
1806
|
/**
|
|
1763
1807
|
* Returns category of the specified or primary provider
|
|
@@ -1848,4 +1892,4 @@ declare class IsaAuth {
|
|
|
1848
1892
|
subscribe(callback: (isAuthenticated: boolean) => void): void | (() => void);
|
|
1849
1893
|
}
|
|
1850
1894
|
|
|
1851
|
-
export { AppleAuthProvider, AuthBaseService, type AuthContext, AuthCore, type AuthFetchOptions, type AuthGuardOptions, type AuthHttpOptions, AuthProvider, type AutoRefreshOptions, CookieSessionStorageAdapter, DiscordAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, type GuardFailureReason, type GuardResult, HttpTokenExchangeAdapter, IsaAuth, type IsaAuthConfig, JwtService, KakaoAuthProvider, LineAuthProvider, LocalStorageAdapter, type MatchMode, MemoryStorageAdapter, MetaAuthProvider, NaverAuthProvider, type PasskeyAssertionResult, PasskeyAuthProvider, type ProviderCategory, type ProviderOptionConfig, type RoleHierarchyMap, SessionStorageAdapter, type StorageConfig, type StorageType, type TokenExchangeAdapter, type TokenExchangeResult, Web3AuthProvider, WorldAuthProvider, type WorldIDProofResult, type WorldVerificationLevel, applyAuthInterceptor, batch, buildAuthorizeUrl, checkPermission, checkRole, clearStoreSession, configureStorage, createAuthAxios, createAuthFetch, createAuthGuard, createNavigationGuard, decodeToken, IsaAuth as default, developerProviders, evaluateGuard, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getProviderCategory, getProvidersByCategory, getRefreshToken, getStorageAdapter, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, identityProviders, isExpiredToken, matchPermissionRule, parseOAuthCallback, index as renderers, resolveInheritedRoles, setRefreshToken, socialProviders, subscribeSelector, updateAuthInfo, web3Providers };
|
|
1895
|
+
export { AppleAuthProvider, AuthBaseService, type AuthContext, AuthCore, type AuthFetchOptions, type AuthGuardOptions, type AuthHttpOptions, AuthProvider, type AutoRefreshOptions, CookieSessionStorageAdapter, DiscordAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, type GuardFailureReason, type GuardResult, HttpTokenExchangeAdapter, IsaAuth, type IsaAuthButtonAttributes, type IsaAuthButtonProps, type IsaAuthConfig, JwtService, KakaoAuthProvider, LineAuthProvider, LocalStorageAdapter, type MatchMode, MemoryStorageAdapter, MetaAuthProvider, NaverAuthProvider, type PasskeyAssertionResult, PasskeyAuthProvider, type ProviderCategory, type ProviderOptionConfig, type RoleHierarchyMap, SessionStorageAdapter, type StorageConfig, type StorageType, type TokenExchangeAdapter, type TokenExchangeResult, Web3AuthProvider, WorldAuthProvider, type WorldIDProofResult, type WorldVerificationLevel, applyAuthInterceptor, batch, buildAuthorizeUrl, checkPermission, checkRole, clearStoreSession, configureStorage, createAuthAxios, createAuthFetch, createAuthGuard, createNavigationGuard, createReactAuthButton, decodeToken, IsaAuth as default, developerProviders, evaluateGuard, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getProviderCategory, getProvidersByCategory, getRefreshToken, getStorageAdapter, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, identityProviders, isExpiredToken, matchPermissionRule, parseOAuthCallback, index as renderers, resolveInheritedRoles, setRefreshToken, socialProviders, subscribeSelector, updateAuthInfo, web3Providers };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface LoginButtonConfig {
|
|
|
5
5
|
style?: Partial<CSSStyleDeclaration>;
|
|
6
6
|
text?: string;
|
|
7
7
|
icon?: string;
|
|
8
|
+
svg?: string;
|
|
8
9
|
fullWidth?: boolean;
|
|
9
10
|
}
|
|
10
11
|
interface LoginButtonProps {
|
|
@@ -20,6 +21,7 @@ declare class LoginButton {
|
|
|
20
21
|
readonly config: LoginButtonConfig;
|
|
21
22
|
constructor(props: LoginButtonProps);
|
|
22
23
|
private getDefaultText;
|
|
24
|
+
private getProviderBrandStyle;
|
|
23
25
|
private getDefaultStyle;
|
|
24
26
|
private mergeStyles;
|
|
25
27
|
getButtonClass(): string;
|
|
@@ -27,7 +29,8 @@ declare class LoginButton {
|
|
|
27
29
|
id: string;
|
|
28
30
|
type: AuthButtonType;
|
|
29
31
|
provider: ButtonProviderType;
|
|
30
|
-
|
|
32
|
+
svg: string;
|
|
33
|
+
icon: string | undefined;
|
|
31
34
|
text: string;
|
|
32
35
|
style: Partial<CSSStyleDeclaration>;
|
|
33
36
|
fullWidth: boolean;
|
|
@@ -1164,10 +1167,11 @@ interface ButtonRenderInfo {
|
|
|
1164
1167
|
label?: string;
|
|
1165
1168
|
className?: string;
|
|
1166
1169
|
icon?: string;
|
|
1170
|
+
svg?: string;
|
|
1167
1171
|
style?: Partial<CSSStyleDeclaration>;
|
|
1168
1172
|
}
|
|
1169
1173
|
/**
|
|
1170
|
-
* Creates and returns a native HTMLButtonElement
|
|
1174
|
+
* Creates and returns a native HTMLButtonElement with vector icons & micro-animations
|
|
1171
1175
|
*/
|
|
1172
1176
|
declare function renderByJs(info: ButtonRenderInfo): HTMLButtonElement;
|
|
1173
1177
|
/**
|
|
@@ -1713,16 +1717,56 @@ declare function renderByVue(info: ButtonRenderInfo): {
|
|
|
1713
1717
|
* Registers custom Web Component <isa-auth-button>
|
|
1714
1718
|
*/
|
|
1715
1719
|
declare function registerWebComponent(): void;
|
|
1720
|
+
/**
|
|
1721
|
+
* TypeScript JSX IntrinsicElements Declaration for Web Component <isa-auth-button>
|
|
1722
|
+
* Eliminates "Property 'isa-auth-button' does not exist on type 'JSX.IntrinsicElements'" in React/Vue/TSX
|
|
1723
|
+
*/
|
|
1724
|
+
interface IsaAuthButtonAttributes {
|
|
1725
|
+
provider?: string;
|
|
1726
|
+
label?: string;
|
|
1727
|
+
class?: string;
|
|
1728
|
+
style?: string;
|
|
1729
|
+
'onisa-auth-click'?: (event: CustomEvent) => void;
|
|
1730
|
+
children?: any;
|
|
1731
|
+
}
|
|
1732
|
+
declare global {
|
|
1733
|
+
namespace JSX {
|
|
1734
|
+
interface IntrinsicElements {
|
|
1735
|
+
'isa-auth-button': IsaAuthButtonAttributes;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1716
1739
|
|
|
1717
1740
|
type index_ButtonRenderInfo = ButtonRenderInfo;
|
|
1741
|
+
type index_IsaAuthButtonAttributes = IsaAuthButtonAttributes;
|
|
1718
1742
|
declare const index_registerWebComponent: typeof registerWebComponent;
|
|
1719
1743
|
declare const index_renderByJs: typeof renderByJs;
|
|
1720
1744
|
declare const index_renderByReact: typeof renderByReact;
|
|
1721
1745
|
declare const index_renderByVue: typeof renderByVue;
|
|
1722
1746
|
declare namespace index {
|
|
1723
|
-
export { type index_ButtonRenderInfo as ButtonRenderInfo, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1747
|
+
export { type index_ButtonRenderInfo as ButtonRenderInfo, type index_IsaAuthButtonAttributes as IsaAuthButtonAttributes, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1724
1748
|
}
|
|
1725
1749
|
|
|
1750
|
+
/**
|
|
1751
|
+
* React Type-Safe Wrapper Component for ISA-AUTH Buttons
|
|
1752
|
+
* Provides 100% TypeScript Props & Event IntelliSense
|
|
1753
|
+
*/
|
|
1754
|
+
|
|
1755
|
+
interface IsaAuthButtonProps {
|
|
1756
|
+
auth?: IsaAuth;
|
|
1757
|
+
provider: CoreProviderType;
|
|
1758
|
+
label?: string;
|
|
1759
|
+
className?: string;
|
|
1760
|
+
style?: Record<string, string | number>;
|
|
1761
|
+
onSuccess?: (user: any) => void;
|
|
1762
|
+
onError?: (error: any) => void;
|
|
1763
|
+
children?: any;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Creates a strongly typed React Component from an IsaAuth instance
|
|
1767
|
+
*/
|
|
1768
|
+
declare function createReactAuthButton(authInstance: IsaAuth): (props: IsaAuthButtonProps) => any;
|
|
1769
|
+
|
|
1726
1770
|
interface ProviderOptionConfig {
|
|
1727
1771
|
clientId?: string;
|
|
1728
1772
|
callbackUrl?: string;
|
|
@@ -1757,7 +1801,7 @@ declare class IsaAuth {
|
|
|
1757
1801
|
private instantiateProvider;
|
|
1758
1802
|
isAuthenticated(): boolean;
|
|
1759
1803
|
getAccessToken(): string | null;
|
|
1760
|
-
getUserInfo():
|
|
1804
|
+
getUserInfo(): any;
|
|
1761
1805
|
getContext(): AuthContext;
|
|
1762
1806
|
/**
|
|
1763
1807
|
* Returns category of the specified or primary provider
|
|
@@ -1848,4 +1892,4 @@ declare class IsaAuth {
|
|
|
1848
1892
|
subscribe(callback: (isAuthenticated: boolean) => void): void | (() => void);
|
|
1849
1893
|
}
|
|
1850
1894
|
|
|
1851
|
-
export { AppleAuthProvider, AuthBaseService, type AuthContext, AuthCore, type AuthFetchOptions, type AuthGuardOptions, type AuthHttpOptions, AuthProvider, type AutoRefreshOptions, CookieSessionStorageAdapter, DiscordAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, type GuardFailureReason, type GuardResult, HttpTokenExchangeAdapter, IsaAuth, type IsaAuthConfig, JwtService, KakaoAuthProvider, LineAuthProvider, LocalStorageAdapter, type MatchMode, MemoryStorageAdapter, MetaAuthProvider, NaverAuthProvider, type PasskeyAssertionResult, PasskeyAuthProvider, type ProviderCategory, type ProviderOptionConfig, type RoleHierarchyMap, SessionStorageAdapter, type StorageConfig, type StorageType, type TokenExchangeAdapter, type TokenExchangeResult, Web3AuthProvider, WorldAuthProvider, type WorldIDProofResult, type WorldVerificationLevel, applyAuthInterceptor, batch, buildAuthorizeUrl, checkPermission, checkRole, clearStoreSession, configureStorage, createAuthAxios, createAuthFetch, createAuthGuard, createNavigationGuard, decodeToken, IsaAuth as default, developerProviders, evaluateGuard, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getProviderCategory, getProvidersByCategory, getRefreshToken, getStorageAdapter, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, identityProviders, isExpiredToken, matchPermissionRule, parseOAuthCallback, index as renderers, resolveInheritedRoles, setRefreshToken, socialProviders, subscribeSelector, updateAuthInfo, web3Providers };
|
|
1895
|
+
export { AppleAuthProvider, AuthBaseService, type AuthContext, AuthCore, type AuthFetchOptions, type AuthGuardOptions, type AuthHttpOptions, AuthProvider, type AutoRefreshOptions, CookieSessionStorageAdapter, DiscordAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, type GuardFailureReason, type GuardResult, HttpTokenExchangeAdapter, IsaAuth, type IsaAuthButtonAttributes, type IsaAuthButtonProps, type IsaAuthConfig, JwtService, KakaoAuthProvider, LineAuthProvider, LocalStorageAdapter, type MatchMode, MemoryStorageAdapter, MetaAuthProvider, NaverAuthProvider, type PasskeyAssertionResult, PasskeyAuthProvider, type ProviderCategory, type ProviderOptionConfig, type RoleHierarchyMap, SessionStorageAdapter, type StorageConfig, type StorageType, type TokenExchangeAdapter, type TokenExchangeResult, Web3AuthProvider, WorldAuthProvider, type WorldIDProofResult, type WorldVerificationLevel, applyAuthInterceptor, batch, buildAuthorizeUrl, checkPermission, checkRole, clearStoreSession, configureStorage, createAuthAxios, createAuthFetch, createAuthGuard, createNavigationGuard, createReactAuthButton, decodeToken, IsaAuth as default, developerProviders, evaluateGuard, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getProviderCategory, getProvidersByCategory, getRefreshToken, getStorageAdapter, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, identityProviders, isExpiredToken, matchPermissionRule, parseOAuthCallback, index as renderers, resolveInheritedRoles, setRefreshToken, socialProviders, subscribeSelector, updateAuthInfo, web3Providers };
|