Installation
Get started by installing the package via npm, yarn, or pnpm:Your First Rule
Let’s create and evaluate your first rule in just a few steps:Congratulations! You just created and evaluated your first rule.
Building Complex Rules
Combining Multiple Conditions
Combine multiple conditions using logical operators to create powerful validation logic:Working with Arrays
Check array membership and combine with other conditions:Dynamic Field Comparison
Compare values from different parts of your data structure:- Basic Comparison
- With Calculated Fields
Common Patterns
Form Validation
Form Validation
User Access Control
User Access Control
E-commerce Pricing
E-commerce Pricing
Working with Different Data Types
Strings
Numbers
Arrays
Nested Objects
Configuration Options
Customize the engine behavior with configuration options:- Basic Configuration
- Security Settings
Best Practices
Start Simple
Begin with simple rules and gradually build complexity. Test each component before combining.
Descriptive Names
Use clear, descriptive variable names that indicate the purpose of each rule.
Test Thoroughly
Test rules with various data scenarios including edge cases and invalid inputs.
Handle Missing Data
Always check for data existence before accessing nested properties.
Debugging Your Rules
Understanding rule evaluation results helps you debug issues quickly:Next Steps
Core Concepts
Learn about the engine architecture and advanced features
Operators Reference
Explore all available operators and their usage
Performance Guide
Optimize your rules for maximum performance
Security Guide
Learn security best practices
Common Questions
Can I save rules to a database?
Can I save rules to a database?
Yes! Rules are JSON objects that can be easily stored and retrieved:
Can I use rules in React components?
Can I use rules in React components?
Absolutely! Rules work great for dynamic UI logic:
How do I optimize performance?
How do I optimize performance?
Follow these key practices:
