@visitorquery/react 0.0.4 → 0.0.6

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.
Files changed (2) hide show
  1. package/README.md +22 -24
  2. package/package.json +41 -42
package/README.md CHANGED
@@ -1,35 +1,33 @@
1
1
  # @visitorquery/react
2
2
 
3
- Use this package to prevent fraud and abuse by visitors hiding behind proxies and VPNs. With a simple call to `useVisitorQuery` your website or app will be making a request to our servers which will respond with a boolean value indicating wether the current user is behind a proxy or VPN. 99.999% of the fraud online is done by individuals hiding behind proxies and VPNs.
3
+ Use this package to prevent fraud and abuse by visitors hiding behind proxies and VPNs. With a simple call
4
+ to `useVisitorQuery` your website or app will be making a request to our servers which will store a value indicating
5
+ wether the current user is behind a proxy or VPN. To see the response, you will need to issue a GET request to
6
+ our [official API](https://visitorquery.com/apidocs#tag/checks/GET/results/{projectId}/{sessionId}).
4
7
 
5
- Our checks are not list based like other services who iterate over a database of known proxy IP addresses. We are using deep packet inspection to detect, in real time, such traffic which is why the api call must be originating from the client's device/browser.
8
+ Our checks are not list based like other services who iterate over a database of known proxy IP addresses. We are using
9
+ deep packet inspection to detect, in real time, such traffic which is why the api call must be originating from the
10
+ client's device/browser. This tool will catch most if not all proxies, VPNs, and Tor traffic - including residential
11
+ ones.
6
12
 
7
- This plugin requires a valid api key (Public api key). To obtain one please visit our website at [visitorquery.com](https://visitorquery.com) and pick a suitable plan.
13
+ This plugin requires a valid api key (Public api key) and that you provision a session id to each visitor. To obtain one
14
+ please visit our website
15
+ at [visitorquery.com](https://visitorquery.com) and pick a suitable plan.
8
16
 
9
17
  Example usage on our own website (nextjs), on the checkout page, before openning the payment dialog:
10
18
 
11
19
  ```typescript
12
20
  import {useVisitorQuery} from "@visitorquery/react";
13
21
 
14
- export default function CheckoutComponent() {
15
- const visitorQuery = useVisitorQuery(
16
- // use your project's PUBLIC api key here
17
- process.env.NEXT_PUBLIC_VISITOR_QUERY_API_KEY!,
18
- );
19
-
20
- useEffect(() => {
21
- if (visitorQuery.is === true && visitorQuery.confidence > 0.6) {
22
- // decide what to do with the visitor
23
- return;
24
- }
25
- }, [visitorQuery]);
26
-
27
- return (
28
- <div>
29
- {visitorQuery.is &&(
30
- <p>You are behind a proxy</p>
31
- )}
32
- </div>
33
- )
22
+ export default function LayoutComponent() {
23
+ // visitorquery should be loaded and your visitor assessed
24
+ // to check the result, issue a GET request from your backend
25
+ const visitorQuery = useVisitorQuery({
26
+ // use your project's !!PUBLIC!! api key here
27
+ ApiKey : process.env.NEXT_PUBLIC_VISITOR_QUERY_API_KEY!,
28
+ SessionId: "unique-session-id-to-later-identify-the-visitor",
29
+ });
34
30
  }
35
- ```
31
+ ```
32
+
33
+ For more info and up to date documentation, please visit our [official page](https://visitorquery.com/docs).
package/package.json CHANGED
@@ -1,44 +1,43 @@
1
1
  {
2
- "version": "0.0.4",
3
- "name": "@visitorquery/react",
4
- "module": "src/index.ts",
5
- "type": "module",
6
- "devDependencies": {
7
- "@types/bun": "latest"
8
- },
9
- "access": "public",
10
- "main": "dist/index.js",
11
- "types": "dist/index.d.ts",
12
- "scripts": {
13
- "build": "bun build --target=node ./src/index.ts --outfile=dist/index.js --external react --external react-dom && bun run build:declaration",
14
- "build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json",
15
- "postbuild": "rimraf tsconfig.types.tsbuildinfo",
16
- "publish": "bun publish --access public",
17
- "release": "git fetch --tags -f && standard-version && git push --follow-tags origin master && bun run publish"
18
- },
19
- "peerDependencies": {
20
- "@types/react": "^19.0.10",
21
- "react": "^19.0.0",
22
- "react-dom": "^19.0.0",
23
- "typescript": "^5.0.0"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "https://github.com/visitorquery/react-hook.git"
28
- },
29
- "keywords": [
30
- "fraud",
31
- "antifraud",
32
- "chargeback",
33
- "proxy",
34
- "visitorquery",
35
- "vpn",
36
- "detect"
37
- ],
38
- "author": "VisitorQuery",
39
- "license": "MIT",
40
- "files": [
41
- "dist/*.js",
42
- "dist/*.d.ts"
43
- ]
2
+ "version": "0.0.6",
3
+ "name": "@visitorquery/react",
4
+ "module": "src/index.ts",
5
+ "type": "module",
6
+ "devDependencies": {
7
+ "@types/bun": "latest"
8
+ },
9
+ "access": "public",
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "scripts": {
13
+ "build": "bun build --target=node ./src/index.ts --outfile=dist/index.js --external react --external react-dom && bun run build:declaration",
14
+ "build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json",
15
+ "postbuild": "rimraf tsconfig.types.tsbuildinfo",
16
+ "release": "git fetch --tags -f && standard-version && git push --follow-tags origin master && bun publish --access public"
17
+ },
18
+ "peerDependencies": {
19
+ "@types/react": "^19.0.10",
20
+ "react": "^19.0.0",
21
+ "react-dom": "^19.0.0",
22
+ "typescript": "^5.0.0"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/visitorquery/react-hook.git"
27
+ },
28
+ "keywords": [
29
+ "fraud",
30
+ "antifraud",
31
+ "chargeback",
32
+ "proxy",
33
+ "visitorquery",
34
+ "vpn",
35
+ "detect"
36
+ ],
37
+ "author": "VisitorQuery",
38
+ "license": "MIT",
39
+ "files": [
40
+ "dist/*.js",
41
+ "dist/*.d.ts"
42
+ ]
44
43
  }