Arkveil is the first lightweight and comprehensive ABAC platform, designed to bring fine-grained security into your applications with clarity and control. It lets you express complex access logic through simple, structured formulas.
npm install @arkveil/nestimport { Module } from "@nestjs/common";
import { ArkveilModule } from "@arkveil/nest";
@Module({
imports: [
ArkveilModule.forRoot({
serviceUrl: "https://api.arkveil.com",
apiKey: "your-api-key",
getUserId: (req) => req.user?.id,
}),
],
})
export class AppModule {}Use the @PermissionPoint decorator:
import { Controller, Get } from "@nestjs/common";
import { PermissionPoint } from "@arkveil/nest";
@Controller("articles")
export class ArticlesController {
@Get("/admin")
@PermissionPoint("content-service.article-delete")
adminAction() {
return "Protected content";
}
}npm install @arkveil/node arkveilimport { Arkveil } from "@arkveil/node";
const arkveil = new Arkveil({
serviceUrl: "https://api.arkveil.com",
apiKey: "your-api-key",
getUserId: (req) => req.user?.id,
});
app.post(
"/api/admin",
arkveil.permissionPoint("content-service.article-delete"),
(req, res) => {
res.json({ message: "Protected content" });
}
);npm install arkveilimport { Arkveil } from "arkveil";
const arkveil = new Arkveil({
serviceUrl: "https://api.arkveil.com",
apiKey: "your-api-key",
});
const result = await arkveil.checkPermission({
actionId: "content-service.article-delete",
user: { id: "user-123" },
context: {},
});
if (result.granted) {
// Allow access
} else {
// Deny access
}- 🔒 Declarative Permission Checks - Use
@PermissionPointdecorator - 🌐 Global Module - Configure once, use everywhere
- 🔄 Async Configuration - Support for ConfigService and dependency injection
- 📡 Multi-Protocol Support - HTTP, GraphQL, and WebSocket contexts
- 🎯 Type-Safe - Full TypeScript support
- 🚀 Framework Agnostic - Works with Express, Fastify, and more
- 🔌 Middleware Pattern - Easy integration with existing apps
- 🎨 Customizable - Custom user extraction and denial handlers
- ⚡ Fast - Optimized for performance
- 🌍 Runtime Agnostic - Works in any JavaScript environment
- 🔧 Flexible - Build your own platform-specific implementations
- 📦 Lightweight - Minimal dependencies
- 🔄 Retry Logic - Built-in retry mechanism for failed requests
This project uses Turborepo for monorepo management and Bun as the JavaScript runtime.
MIT