Familiar syntax
JavaScript operators and names. Every function is also a method, so sum(xs) and xs.sum() are the same call.
A small expression language for pricing rules, saved filters, formula fields, and user-authored logic. JavaScript syntax, checked against your data types before it runs, and bounded when it does.

// Method chains on any value
" hello world ".trim().toUpperCase()→ "HELLO WORLD"
// Null-safe defaults
user.profile.avatar ?? "default.png"→ "default.png"
// "." is the current item
users.filter(.age >= 18).map(.name)→ ["Alice"]
eval() would be recklessA pricing rule changes every quarter. With Bonsai it is a text field in your admin panel, checked against your data types when it is saved.
order.total >= freeShippingThreshold
&& customer.tier == "gold"Store a saved view as a string and evaluate it per row, with no custom query parser to build or maintain.
orders.filter(
.status == "pending"
&& now() - .placedAt > days(2)
)Template expressions live alongside the copy, not buried in application code or a separate engine.
`Hi ${user.firstName},
order ${order.id} ships
${order.shipDate.formatDate("dd MMM")}`