@skippr/live-agent-sdk 0.14.0 → 0.16.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.md +17 -0
- package/dist/esm/lib-exports.js +632 -180
- package/dist/skippr-sdk.css +1 -1
- package/dist/skippr-sdk.js +128 -128
- package/dist/types/components/LiveAgent.d.ts +2 -1
- package/dist/types/components/LoginFlow.d.ts +8 -0
- package/dist/types/context/LiveAgentContext.d.ts +7 -0
- package/dist/types/hooks/useAuth.d.ts +14 -0
- package/dist/types/hooks/useSession.d.ts +2 -1
- package/package.json +1 -1
|
@@ -3,8 +3,9 @@ interface LiveAgentProps {
|
|
|
3
3
|
agentId: string;
|
|
4
4
|
authToken?: string | undefined;
|
|
5
5
|
appKey?: string | undefined;
|
|
6
|
+
userToken?: string | undefined;
|
|
6
7
|
defaultOpen?: boolean;
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
}
|
|
9
|
-
export declare function LiveAgent({ agentId, authToken, appKey, defaultOpen, children, }: LiveAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function LiveAgent({ agentId, authToken: authTokenProp, appKey, userToken, defaultOpen, children, }: LiveAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface LoginFlowProps {
|
|
2
|
+
requestOtp: (email: string) => Promise<boolean>;
|
|
3
|
+
verifyOtp: (email: string, code: string) => Promise<void>;
|
|
4
|
+
error: string;
|
|
5
|
+
isSubmitting: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function LoginFlow({ requestOtp, verifyOtp, error, isSubmitting }: LoginFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -8,6 +8,13 @@ export interface LiveAgentPublicValue {
|
|
|
8
8
|
openPanel: () => void;
|
|
9
9
|
closePanel: () => void;
|
|
10
10
|
togglePanel: () => void;
|
|
11
|
+
isAuthenticated: boolean;
|
|
12
|
+
isValidating: boolean;
|
|
13
|
+
authError: string;
|
|
14
|
+
requestOtp: (email: string) => Promise<boolean>;
|
|
15
|
+
verifyOtp: (email: string, code: string) => Promise<void>;
|
|
16
|
+
logoutAuth: () => void;
|
|
17
|
+
isAuthSubmitting: boolean;
|
|
11
18
|
}
|
|
12
19
|
export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
13
20
|
connection: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface UseAuthParams {
|
|
2
|
+
appKey?: string | undefined;
|
|
3
|
+
}
|
|
4
|
+
export declare function useAuth({ appKey }: UseAuthParams): {
|
|
5
|
+
isAuthenticated: boolean;
|
|
6
|
+
isValidating: boolean;
|
|
7
|
+
authToken: string | null;
|
|
8
|
+
requestOtp: (email: string) => Promise<boolean>;
|
|
9
|
+
verifyOtp: (email: string, code: string) => Promise<void>;
|
|
10
|
+
logout: () => void;
|
|
11
|
+
error: string;
|
|
12
|
+
isSubmitting: boolean;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -6,8 +6,9 @@ interface UseSessionParams {
|
|
|
6
6
|
agentId: string;
|
|
7
7
|
authToken?: string | undefined;
|
|
8
8
|
appKey?: string | undefined;
|
|
9
|
+
userToken?: string | undefined;
|
|
9
10
|
}
|
|
10
|
-
export declare function useSession({ agentId, authToken, appKey }: UseSessionParams): {
|
|
11
|
+
export declare function useSession({ agentId, authToken, appKey, userToken }: UseSessionParams): {
|
|
11
12
|
connection: LiveKitConnection | null;
|
|
12
13
|
shouldConnect: boolean;
|
|
13
14
|
isStarting: boolean;
|