bext_plugin_quickjs/lib.rs
1//! bext-plugin-quickjs: QuickJS-based sandbox for lightweight JS plugin execution.
2//!
3//! Embeds QuickJS via `rquickjs` to run tenant-supplied JavaScript in a secure,
4//! memory-limited, time-limited sandbox. Ideal for business logic scripts:
5//! pricing rules, data transforms, webhook handlers.
6//!
7//! The JS runtime exposes a controlled API surface:
8//! - `console.log/warn/error/info/debug` — structured logging
9//! - `bext.storage.get/set/delete` — per-plugin scoped storage
10//! - `bext.fetch(url, options)` — rate-limited, URL-allowlisted HTTP
11//! - `bext.config` — plugin configuration object
12//! - `bext.metric(name, value, tags)` — metric emission
13
14pub mod api;
15pub mod runtime;
16
17pub use runtime::{QuickJsPluginConfig, QuickJsPluginRuntime};