https://github.com/permitio/fine-grained-bot-protection
An example authorization middleware for fine-grained bot protection using Arcjet and Permit.io
https://github.com/permitio/fine-grained-bot-protection
example
Last synced: 5 months ago
JSON representation
An example authorization middleware for fine-grained bot protection using Arcjet and Permit.io
- Host: GitHub
- URL: https://github.com/permitio/fine-grained-bot-protection
- Owner: permitio
- License: apache-2.0
- Created: 2024-07-05T10:19:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-09T11:10:24.000Z (about 1 year ago)
- Last Synced: 2025-08-29T15:26:13.347Z (5 months ago)
- Topics: example
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fine-Grained Bot Protection Demo
This project demonstrates an effective way to handle bots in your application using fine-grained authorization.
By integrating Permit.io and Arcjet, this application showcases how to serve different types of data to various bots and human users, ensuring optimal readiness for GenAI and other bots.
Read more about it in the following [blog post](https://www.permit.io/blog/introduce-ai-bots-in-applications): [https://www.permit.io/blog/introduce-ai-bots-in-applications](https://www.permit.io/blog/introduce-ai-bots-in-applications)
## Prerequisites
- Node.js
- npm
- Arcjet Security API Key
- Permit.io API Key
- Docker
## Installation
1. Clone the repository
2. Install dependencies
```bash
npm install
```
3. Copy the .env.template file to .env and update the values
```bash
cp .env.template .env
```
4. Follow the instructions in the following blog post to set your application policy in Permit.io
[TBD - Add the link to the blog post](#)
5. Run the Permit PDP using your Permit.io API Key
```bash
docker run -p 7766:7000 --env PDP_API_KEY= --env PDP_DEBUG=true permitio/pdp-v2:latest
```
5. Start the application
```bash
npm run dev
```
## Usage
1. Open your browser and navigate to [http://localhost:3000](http://localhost:3000). As you can see, you are able to access Public, Shared, and Private items.
2. Try to call the API using curl
```bash
curl http://localhost:3000
```
You will get only Public items