@authsignal/browser 0.0.16 → 0.0.18

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.
@@ -0,0 +1,15 @@
1
+ import { AuthsignalOptions, LaunchOptions, TokenPayload } from "./types";
2
+ export declare class Authsignal {
3
+ anonymousId: string;
4
+ cookieDomain: string;
5
+ anonymousIdCookieName: string;
6
+ publishableKey: string;
7
+ private _token;
8
+ constructor({ publishableKey, cookieDomain, cookieName }: AuthsignalOptions);
9
+ launch(url: string, options?: {
10
+ mode?: "redirect";
11
+ } & LaunchOptions): undefined;
12
+ launch(url: string, options?: {
13
+ mode: "popup";
14
+ } & LaunchOptions): Promise<TokenPayload>;
15
+ }
@@ -0,0 +1,11 @@
1
+ declare type CookieOptions = {
2
+ name: string;
3
+ value: string;
4
+ expire: number;
5
+ domain: string;
6
+ secure: boolean;
7
+ };
8
+ export declare const setCookie: ({ name, value, expire, domain, secure }: CookieOptions) => void;
9
+ export declare const getCookieDomain: () => string;
10
+ export declare const getCookie: (name: string) => string | null;
11
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,46 +1,2 @@
1
- type LaunchOptions = {
2
- /**
3
- * How the Authsignal Prebuilt MFA page should launch.
4
- * `popup` will cause it to open in a overlay, whilst `redirect`
5
- * will trigger a full page redirect.
6
- * If no value is supplied, mode defaults to `redirect`.
7
- */
8
- mode?: "popup" | "redirect";
9
- };
10
- type AuthsignalOptions = {
11
- publishableKey: string;
12
- /**
13
- * Cookie domain that will be used to identify
14
- * users. If not set, location.hostname will be used
15
- */
16
- cookieDomain?: string;
17
- /**
18
- * Tracking host (where API calls will be sent). If not set,
19
- * we'd try to do the best to "guess" it. Last resort is t.authsignal.com.
20
- *
21
- * Though this parameter is not required, it's highly recommended to set is explicitly
22
- */
23
- trackingHost?: string;
24
- /**
25
- * Name of id cookie. __eventn_id by default
26
- */
27
- cookieName?: string;
28
- };
29
- type TokenPayload = {
30
- token?: string;
31
- };
32
- declare class Authsignal {
33
- anonymousId: string;
34
- cookieDomain: string;
35
- anonymousIdCookieName: string;
36
- publishableKey: string;
37
- private _token;
38
- constructor({ publishableKey, cookieDomain, cookieName }: AuthsignalOptions);
39
- launch(url: string, options?: {
40
- mode?: "redirect";
41
- } & LaunchOptions): undefined;
42
- launch(url: string, options?: {
43
- mode: "popup";
44
- } & LaunchOptions): Promise<TokenPayload>;
45
- }
46
- export { Authsignal };
1
+ export * from "./authsignal";
2
+ export * from "./types";