@authsignal/browser 0.0.5 → 0.0.8

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/index.d.ts CHANGED
@@ -1,9 +1,13 @@
1
- type Challenge = {
1
+ type ChallengeInput = {
2
2
  challengeUrl: string;
3
3
  mode?: "popup" | "redirect";
4
4
  };
5
- type Mfa = {
5
+ type MfaInput = {
6
6
  url: string;
7
+ mode?: "popup" | "redirect";
8
+ };
9
+ type LaunchOptions = {
10
+ mode?: "popup" | "redirect";
7
11
  };
8
12
  type AuthsignalOptions = {
9
13
  publishableKey: string;
@@ -23,19 +27,52 @@ type AuthsignalOptions = {
23
27
  * Name of id cookie. __eventn_id by default
24
28
  */
25
29
  cookieName?: string;
30
+ /**
31
+ * A URL pointing to the Authsignal MFA page.
32
+ */
33
+ endpoint?: string;
26
34
  };
27
- declare class AuthsignalBrowser {
28
- private anonymousId;
29
- private cookieDomain;
30
- private anonymousIdCookieName;
31
- private publishableKey;
32
- constructor({ publishableKey, cookieDomain, cookieName }: AuthsignalOptions);
33
- mfa({ url }: Mfa): void;
35
+ declare class Authsignal {
36
+ anonymousId: string;
37
+ cookieDomain: string;
38
+ anonymousIdCookieName: string;
39
+ publishableKey: string;
40
+ endpoint: string;
41
+ constructor({ publishableKey, cookieDomain, cookieName, endpoint }: AuthsignalOptions);
42
+ /**
43
+ * @deprecated Use launch() instead.
44
+ */
45
+ /**
46
+ * @deprecated Use launch() instead.
47
+ */
48
+ mfa(challenge: {
49
+ mode?: "redirect";
50
+ } & MfaInput): undefined;
51
+ mfa(challenge: {
52
+ mode: "popup";
53
+ } & MfaInput): Promise<boolean>;
54
+ /**
55
+ * @deprecated Use launch() instead.
56
+ */
57
+ /**
58
+ * @deprecated Use launch() instead.
59
+ */
34
60
  challenge(challenge: {
35
61
  mode?: "redirect";
36
- } & Challenge): undefined;
62
+ } & ChallengeInput): undefined;
37
63
  challenge(challenge: {
38
64
  mode: "popup";
39
- } & Challenge): Promise<boolean>;
65
+ } & ChallengeInput): Promise<boolean>;
66
+ launch(url: string, options?: {
67
+ mode?: "redirect";
68
+ } & LaunchOptions): undefined;
69
+ launch(url: string, options?: {
70
+ mode: "popup";
71
+ } & LaunchOptions): Promise<boolean>;
72
+ }
73
+ /**
74
+ * @deprecated Use Authsignal
75
+ */
76
+ declare class AuthsignalBrowser extends Authsignal {
40
77
  }
41
- export { AuthsignalBrowser };
78
+ export { Authsignal, AuthsignalBrowser };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@authsignal/browser",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.8",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/index.d.ts",