bot-shield 1.0.1 → 1.0.5

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 +6 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,14 +7,14 @@ This package protects your valuable API endpoints by filtering out automated scr
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- npm install bot-shield-mca
10
+ npm install bot-shield
11
11
  ```
12
12
 
13
13
  ## Basic Usage
14
14
 
15
15
  ```javascript
16
16
  const express = require('express');
17
- const BotShield = require('bot-shield-mca');
17
+ const BotShield = require('bot-shield');
18
18
 
19
19
  const app = express();
20
20
  const botShield = new BotShield({
@@ -24,7 +24,7 @@ const botShield = new BotShield({
24
24
  });
25
25
 
26
26
  // 1. Expose the challenge token endpoint
27
- app.get('/api/bot-challenge', botShield.challengeEndpoint);
27
+ app.get('/api/shield/init', botShield.challengeEndpoint);
28
28
 
29
29
  // 2. Protect your valuable data API with the middleware
30
30
  app.get('/api/data', botShield.protectApi, (req, res) => {
@@ -40,14 +40,14 @@ Legitimate browsers must solve the execution challenge to retrieve the token and
40
40
 
41
41
  ```javascript
42
42
  // Step 1: Challenge
43
- const challenge = await fetch('http://localhost:3000/api/bot-challenge');
43
+ const challenge = await fetch('/api/shield/init');
44
44
  const { token } = await challenge.json();
45
45
 
46
46
  // Step 2: Retrieve protected data
47
- const response = await fetch('http://localhost:3000/api/data', {
47
+ const response = await fetch('/api/data', {
48
48
  headers: {
49
49
  'x-shield-token': token
50
50
  }
51
51
  });
52
52
  const data = await response.json();
53
- ```
53
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bot-shield",
3
- "version": "1.0.1",
3
+ "version": "1.0.5",
4
4
  "description": "An Economic Deterrence Bot Mitigation Middleware for Express",
5
5
  "main": "index.js",
6
6
  "scripts": {