Packages
@runtimee/core
Pure TypeScript authorization kernel
@runtimee/core
The core package of Runtimee is a pure TypeScript authorization kernel with zero blockchain dependencies.
It provides the foundational types, policy engine, and decision-making logic for financial actors.
Features
- Pure TypeScript: No runtime dependencies, zero I/O, and no blockchain-specific code.
- Policy Engine: Flexible authorization with composable policies.
- Deterministic: Same inputs always produce the same authorization decision.
- Extensible: Easy to add custom policy types.
Key Exports
Types
All core types are exported from the package:
import type {
Actor,
Budget,
Policy,
Intent,
AuthorizationDecision,
// ... and many more
} from "@runtimee/core"Policy Factory Functions
Create policies using the factory functions:
import {
createBudgetCheckPolicy,
createAllowlistPolicy,
createMaxPerCallPolicy,
createRateLimitPolicy
} from "@runtimee/core/policies"
// Example: create a budget check policy
const budgetPolicy = createBudgetCheckPolicy({
id: "budget-1",
version: "1",
config: {
amount: "1000000000000", // 1 USDC in wei (6 decimals)
currency: "USDC",
period: "monthly"
}
))Authorization
The core authorization logic:
import { PolicyEngine } from "@runtimee/core"
// Create an engine with your policies
const engine = new PolicyEngine([budgetPolicy, allowlistPolicy])
// Evaluate an intent
const authorization = await engine.evaluate(actor, intent, budgetState)Installation
npm install @runtimee/core
# or
pnpm add @runtimee/coreLicense
Apache 2.0
How is this guide?