@authsignal/browser 0.0.7 → 0.0.10
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/cjs/index.js +99 -27
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +99 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +55 -12
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
type
|
|
1
|
+
type ChallengeInput = {
|
|
2
2
|
challengeUrl: string;
|
|
3
3
|
mode?: "popup" | "redirect";
|
|
4
4
|
};
|
|
5
|
-
type
|
|
5
|
+
type MfaInput = {
|
|
6
6
|
url: string;
|
|
7
|
+
mode?: "popup" | "redirect";
|
|
8
|
+
};
|
|
9
|
+
type LaunchOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* How the Authsignal Prebuilt MFA page should launch.
|
|
12
|
+
* `popup` will cause it to open in a overlay, whilst `redirect`
|
|
13
|
+
* will trigger a full page redirect.
|
|
14
|
+
* If no value is supplied, mode defaults to `redirect`.
|
|
15
|
+
*/
|
|
16
|
+
mode?: "popup" | "redirect";
|
|
7
17
|
};
|
|
8
18
|
type AuthsignalOptions = {
|
|
9
19
|
publishableKey: string;
|
|
@@ -23,19 +33,52 @@ type AuthsignalOptions = {
|
|
|
23
33
|
* Name of id cookie. __eventn_id by default
|
|
24
34
|
*/
|
|
25
35
|
cookieName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* A URL pointing to the Authsignal MFA page.
|
|
38
|
+
*/
|
|
39
|
+
endpoint?: string;
|
|
26
40
|
};
|
|
27
|
-
declare class
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
declare class Authsignal {
|
|
42
|
+
anonymousId: string;
|
|
43
|
+
cookieDomain: string;
|
|
44
|
+
anonymousIdCookieName: string;
|
|
45
|
+
publishableKey: string;
|
|
46
|
+
endpoint: string;
|
|
47
|
+
constructor({ publishableKey, cookieDomain, cookieName, endpoint }: AuthsignalOptions);
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use launch() instead.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use launch() instead.
|
|
53
|
+
*/
|
|
54
|
+
mfa(challenge: {
|
|
55
|
+
mode?: "redirect";
|
|
56
|
+
} & MfaInput): undefined;
|
|
57
|
+
mfa(challenge: {
|
|
58
|
+
mode: "popup";
|
|
59
|
+
} & MfaInput): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Use launch() instead.
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use launch() instead.
|
|
65
|
+
*/
|
|
34
66
|
challenge(challenge: {
|
|
35
67
|
mode?: "redirect";
|
|
36
|
-
} &
|
|
68
|
+
} & ChallengeInput): undefined;
|
|
37
69
|
challenge(challenge: {
|
|
38
70
|
mode: "popup";
|
|
39
|
-
} &
|
|
71
|
+
} & ChallengeInput): Promise<boolean>;
|
|
72
|
+
launch(url: string, options?: {
|
|
73
|
+
mode?: "redirect";
|
|
74
|
+
} & LaunchOptions): undefined;
|
|
75
|
+
launch(url: string, options?: {
|
|
76
|
+
mode: "popup";
|
|
77
|
+
} & LaunchOptions): Promise<boolean>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use Authsignal
|
|
81
|
+
*/
|
|
82
|
+
declare class AuthsignalBrowser extends Authsignal {
|
|
40
83
|
}
|
|
41
|
-
export { AuthsignalBrowser };
|
|
84
|
+
export { Authsignal, AuthsignalBrowser };
|