@tribecloud/sdk 1.0.0 → 1.0.1
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/dist/esm/core.d.ts +19 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +15218 -10
- package/dist/esm/types.d.ts +59 -1
- package/dist/iife/sdk.min.js +59 -20
- package/package.json +4 -1
package/dist/esm/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TribeConfig, TribeSDK, User, Announcement, FeedbackOptions, ApiKey, ApiKeyResult, ActiveDevice, ForgotPasswordOptions, ResendVerificationOptions, MagicLinkOptions, AuthConfig } from "./types";
|
|
1
|
+
import type { TribeConfig, TribeSDK, User, Announcement, FeedbackOptions, ApiKey, ApiKeyResult, ActiveDevice, ForgotPasswordOptions, ResendVerificationOptions, MagicLinkOptions, AuthConfig, RedirectOptions, SocialProvider, PaymentOptions, PaymentResult, PaymentStatus, PaymentConfig } from "./types";
|
|
2
2
|
export declare class Tribe implements TribeSDK {
|
|
3
3
|
private siteId;
|
|
4
4
|
private baseUrl;
|
|
@@ -6,28 +6,40 @@ export declare class Tribe implements TribeSDK {
|
|
|
6
6
|
private pageStart;
|
|
7
7
|
private currentPath;
|
|
8
8
|
private tokenKey;
|
|
9
|
+
private userTokenKey;
|
|
9
10
|
private anonIdKey;
|
|
10
11
|
private autoTrackingActive;
|
|
11
12
|
private originalPushState;
|
|
12
13
|
private popstateHandler;
|
|
13
14
|
private visibilityHandler;
|
|
14
|
-
|
|
15
|
+
/** @internal _baseUrl is used by the IIFE entry point; not part of the public API. */
|
|
16
|
+
constructor(config: TribeConfig & {
|
|
17
|
+
_baseUrl?: string;
|
|
18
|
+
});
|
|
15
19
|
static init(config: TribeConfig): Tribe;
|
|
16
20
|
startAutoTracking(): void;
|
|
17
21
|
stopAutoTracking(): void;
|
|
22
|
+
private handleAuthCallback;
|
|
23
|
+
redirectToLogin(options?: RedirectOptions): void;
|
|
24
|
+
redirectToRegister(options?: RedirectOptions): void;
|
|
25
|
+
redirectToSocialLogin(provider: SocialProvider, options?: RedirectOptions): void;
|
|
18
26
|
private sendEvent;
|
|
19
27
|
private gql;
|
|
20
28
|
private getAnonymousId;
|
|
21
29
|
register(email: string, password: string): Promise<{
|
|
22
30
|
user: User;
|
|
31
|
+
userToken?: string | null;
|
|
23
32
|
}>;
|
|
24
33
|
login(email: string, password: string): Promise<{
|
|
25
34
|
user: User;
|
|
35
|
+
userToken?: string | null;
|
|
26
36
|
}>;
|
|
27
37
|
logout(): Promise<void>;
|
|
28
38
|
getSession(): Promise<{
|
|
29
39
|
user: User;
|
|
40
|
+
userToken?: string | null;
|
|
30
41
|
} | null>;
|
|
42
|
+
getUserToken(): string | null;
|
|
31
43
|
track(eventName: string, data?: Record<string, unknown>): void;
|
|
32
44
|
feedback(message: string, options?: FeedbackOptions): Promise<void>;
|
|
33
45
|
getFeatureFlag(key: string): Promise<boolean>;
|
|
@@ -40,6 +52,7 @@ export declare class Tribe implements TribeSDK {
|
|
|
40
52
|
requestMagicLink(email: string, options?: MagicLinkOptions): Promise<void>;
|
|
41
53
|
verifyMagicLink(token: string): Promise<{
|
|
42
54
|
user: User;
|
|
55
|
+
userToken?: string | null;
|
|
43
56
|
}>;
|
|
44
57
|
getAuthConfig(): Promise<AuthConfig>;
|
|
45
58
|
setRole(role: string): Promise<User>;
|
|
@@ -49,4 +62,8 @@ export declare class Tribe implements TribeSDK {
|
|
|
49
62
|
invalidateAllSessions(): Promise<void>;
|
|
50
63
|
getActiveDevices(): Promise<ActiveDevice[]>;
|
|
51
64
|
revokeSession(sessionId: string): Promise<void>;
|
|
65
|
+
getPaymentConfig(): Promise<PaymentConfig>;
|
|
66
|
+
getQrCode(options: PaymentOptions): Promise<PaymentResult>;
|
|
67
|
+
sendViaPhantom(options: PaymentOptions): Promise<PaymentStatus>;
|
|
68
|
+
verifyPayment(paymentId: string, txSignature?: string): Promise<PaymentStatus>;
|
|
52
69
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Tribe } from "./core";
|
|
2
2
|
export { Tribe as default } from "./core";
|
|
3
|
-
export type { TribeConfig, TribeSDK, User, Announcement, FeedbackOptions, ApiKey, ApiKeyResult, ActiveDevice, ForgotPasswordOptions, ResendVerificationOptions, MagicLinkOptions, AuthConfig, } from "./types";
|
|
3
|
+
export type { TribeConfig, TribeSDK, User, Announcement, FeedbackOptions, ApiKey, ApiKeyResult, ActiveDevice, ForgotPasswordOptions, ResendVerificationOptions, MagicLinkOptions, AuthConfig, RedirectOptions, PaymentOptions, PaymentResult, PaymentStatus, AcceptedToken, PaymentConfig, } from "./types";
|