Quick Start
Get your first governed execution running in under 5 minutes.
1. Create an account
Sign up at stellrai.com. Your API key is shown once on the onboarding screen — copy it now.
2. Install the SDK
Package: @hybridb/sdk on npm
bash
npm install @hybridb/sdkbash
yarn add @hybridb/sdkbash
pnpm add @hybridb/sdk3. Initialise the client
typescript
import { HybriDBClient } from '@hybridb/sdk';
const hdb = new HybriDBClient({
baseUrl: 'https://hybridb.stellrai.com',
apiKey: process.env.HDB_API_KEY!,
});Store your API key in an environment variable. Never hardcode it or expose it in client-side code.
4. Request a decision
Before any governed action runs, request a decision. The policy engine evaluates your rules and returns approved, blocked, or escalated.
typescript
const decision = await hdb.requestDecision({
decisionType: 'payment.authorize',
action: 'payment.initiate',
inputData: {
actorId: 'user:alice',
amount: 15000,
currency: 'USD',
},
});
if (decision.outcome !== 'approved') {
// Policy blocked — do not proceed
throw new Error(`Blocked: ${decision.rationale}`);
}5. Trigger a pipeline
Pass the decisionId when triggering a pipeline. Stellrai enforces that a valid approved decision exists before execution starts.
typescript
const execution = await hdb.triggerPipelineByName('payment.execute.standard', {
decisionId: decision.decisionId,
input: {
amount: 15000,
to: 'acct_9k2x',
},
});
console.log(execution.id); // exec_abc123
console.log(execution.status); // 'completed'6. Roll back if needed
Every execution is reversible within its rollback window (default: 30 minutes).
typescript
await hdb.reversibility.rollback(execution.id, {
reason: 'user_request',
});What just happened
Behind the scenes Stellrai ran the full governance loop automatically:
| Step | What happened |
|---|---|
| Policy check | Your rules were evaluated against the input data |
| Decision issued | approved result stored with full rationale |
| Execution checkpointed | Every pipeline step was traced and saved |
| Audit entry written | Immutable log entry created — actor, action, outcome |
| Rollback armed | Compensation handlers registered, reversible for 30 min |
Next steps
- Core Concepts — understand the runtime contract
- SDK Reference — full method documentation
- REST API — direct HTTP access without the SDK