@authsignal/browser 0.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/README.md +38 -0
- package/dist/cjs/index.js +3776 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +3771 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/package.json +47 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
type AuthsignalChallenge = {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
challengeUrl: string;
|
|
4
|
+
};
|
|
5
|
+
type AnnoymousId = {
|
|
6
|
+
idCookie: string;
|
|
7
|
+
generated: boolean;
|
|
8
|
+
};
|
|
9
|
+
interface UserProps {
|
|
10
|
+
id?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
}
|
|
13
|
+
type AuthsignalOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Cookie domain that will be used to identify
|
|
16
|
+
* users. If not set, location.hostname will be used
|
|
17
|
+
*/
|
|
18
|
+
cookie_domain?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Tracking host (where API calls will be sent). If not set,
|
|
21
|
+
* we'd try to do the best to "guess" it. Last resort is t.authsignal.com.
|
|
22
|
+
*
|
|
23
|
+
* Though this parameter is not required, it's highly recommended to set is explicitly
|
|
24
|
+
*/
|
|
25
|
+
tracking_host?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Name of id cookie. __eventn_id by default
|
|
28
|
+
*/
|
|
29
|
+
cookie_name?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function authsignalClient(publishableKey: string, options?: AuthsignalOptions): AuthsignalClient;
|
|
32
|
+
declare class AuthsignalClient {
|
|
33
|
+
private anonymousId;
|
|
34
|
+
private initialized;
|
|
35
|
+
private publishableKey;
|
|
36
|
+
private cookieDomain;
|
|
37
|
+
private idCookieName;
|
|
38
|
+
private trackingHost;
|
|
39
|
+
private fingerprintClient?;
|
|
40
|
+
private deviceFingerprint?;
|
|
41
|
+
init(publishableKey: string, options?: AuthsignalOptions): Promise<void>;
|
|
42
|
+
identify(props: UserProps): Promise<void>;
|
|
43
|
+
getAnonymousId(): AnnoymousId;
|
|
44
|
+
challengeWithPopup({ challengeUrl }: AuthsignalChallenge): Promise<boolean>;
|
|
45
|
+
private registerIdentity;
|
|
46
|
+
private registerAnonymousId;
|
|
47
|
+
private buildRegisterAnonymousIdRequest;
|
|
48
|
+
private sendJson;
|
|
49
|
+
private xmlHttpReqTransport;
|
|
50
|
+
}
|
|
51
|
+
export { authsignalClient, AuthsignalClient };
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@authsignal/browser",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"keywords": ["authsignal", "mfa", "2fa", "authentication"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": "git://github.com/authsignal/authsignal-browser.git",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"scripts": {
|
|
13
|
+
"typecheck": "tsc",
|
|
14
|
+
"clean": "rm -rf ./dist",
|
|
15
|
+
"lint": "eslint \"{cli,config,src,test}/**/*.ts\"",
|
|
16
|
+
"build": "rollup --configPlugin rollup-plugin-ts --config rollup.config.ts"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@fingerprintjs/fingerprintjs": "^3.3.3",
|
|
20
|
+
"a11y-dialog": "^7.4.0",
|
|
21
|
+
"uuid": "^8.3.2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
25
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
26
|
+
"@types/basiclightbox": "^5.0.1",
|
|
27
|
+
"@types/uuid": "^8.3.4",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^5.25.0",
|
|
29
|
+
"@typescript-eslint/parser": "^5.25.0",
|
|
30
|
+
"eslint": "^8.15.0",
|
|
31
|
+
"eslint-config-prettier": "^8.5.0",
|
|
32
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
33
|
+
"prettier": "^2.6.2",
|
|
34
|
+
"rollup": "^2.73.0",
|
|
35
|
+
"rollup-plugin-ts": "^2.0.7",
|
|
36
|
+
"tslib": "^2.4.0",
|
|
37
|
+
"typescript": "^4.6.4"
|
|
38
|
+
},
|
|
39
|
+
"files": ["dist"],
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"import": "./dist/esm/index.js",
|
|
43
|
+
"require": "./dist/cjs/index.js",
|
|
44
|
+
"types": "./dist/index.d.ts"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|