Getting Started
Learn how to install and start using Bantai
Getting Started
Welcome to Bantai! This guide will help you get up and running with Bantai, a type-safe policy evaluation library for building complex validation and decision-making logic.
What You'll Learn
In this section, you'll learn how to:
- Install Bantai and its dependencies in your project
- Create your first policy with contexts, rules, and evaluation
- Understand core concepts like type safety, evaluation strategies, and hooks
- Build real-world solutions using Bantai's composable architecture
Quick Overview
Bantai follows a simple five-phase workflow:
- Define Context - Create type-safe schemas using Zod
- Craft Rules - Write validation logic that returns
allow()ordeny() - Compose Policies - Group rules with evaluation strategies
- Execute Evaluation - Get instant decisions with detailed results
- Handle Results - Use decisions and violations to power your app
Getting Started Guide
Ready to dive in? Follow these steps:
- Installation - Install Bantai and set up your project
- Quick Start - Create your first policy in minutes
Prerequisites
Before you begin, make sure you have:
- Node.js >= 18
- TypeScript >= 5.0
- Zod >= 4.3.5 (peer dependency)
What's Next?
Once you've completed the getting started guide, explore:
- Concepts - Deep dive into contexts, rules, and policies
- API Reference - Complete API documentation
- Examples - Real-world use cases and patterns
- Extensions - Add rate limiting, storage, and more
Let's get started! Begin with Installation.