OxinionDeveloper
oxinion.edge.rules

Logic conditions that compose.

Rules define the conditions that Gate evaluates. Build if/else trees, range checks, and boolean logic — composing complex decision rules from simple, reusable primitives without writing infrastructure code.

Stable
Generally Available

Simple by design

Rules define the conditions that Gate evaluates. Build if/else trees, range checks, and boolean logic — composing complex decision rules from simple, reusable primitives without writing infrastructure code.

  • 01Operators: eq, neq, gt, gte, lt, lte, in, contains
  • 02Combine with AND / OR — nest as deep as needed
  • 03Reuse rules across multiple Gates
Full API reference
TypeScript
1import { createOxinion } from 'oxinion';
2
3const oxinion = createOxinion({ accessToken });
4
5// Create a reusable rule
6const rule = await oxinion.edge.rules.create({
7 name: "High-value returning customer",
8 conditions: [
9 { field: "visitCount", operator: "gte", value: 5 },
10 { field: "totalSpent", operator: "gte", value: 500 },
11 { field: "optedIn", operator: "eq", value: true },
12 { operator: "and" }
13 ]
14});
15
16// Attach to a Gate
17await oxinion.edge.gate.evaluate({
18 event: { userId: "user_123" },
19 ruleIds: [rule.id]
20});

Decisions as code. Not config files.

Rules give you expressive, composable logic — defined once, used everywhere.