@venturekit/core
v0.0.21
Published
VentureKit core types, presets, and configuration resolution.
Readme
@venturekit/core
Warning: This package is in active development and not production-ready. APIs may change without notice.
Core types, presets, and configuration resolution for VentureKit.
Installation
npm install @venturekit/core@devOverview
@venturekit/core is the foundation of the VentureKit framework. It provides:
- Type definitions for all configuration layers (base, environment)
- Presets for quick environment sizing (
nano,micro,medium,large) - Configuration resolution that merges base + environment into a single resolved config
- Validation utilities for all configuration types
- Infrastructure intent types for declarative resource provisioning
Every other VentureKit package depends on @venturekit/core.
Configuration Layers
VentureKit uses a layered configuration system:
| Layer | Purpose | Changes per environment? |
|-------|---------|--------------------------|
| BaseConfig | Project identity (name, region) | No |
| EnvConfigInput | Resource sizing, scaling | Yes |
Authentication pools and app clients are declared as auth intents in
vk.config.ts (see Infrastructure Intents below). Authorization scopes
are enforced server-side by @venturekit/runtime's scope gate — they
are application policy, not project configuration.
Base Config
import type { BaseConfig } from '@venturekit/core';
const base: BaseConfig = {
name: 'my-api',
displayName: 'My API',
region: 'eu-west-1',
};Environment Config
import type { EnvConfigInput } from '@venturekit/core';
const dev: EnvConfigInput = {
preset: 'nano',
dataSafety: 'relaxed',
api: { cors: { allowOrigins: ['http://localhost:3000'] } },
};Presets
| Preset | Lambda | Timeout | API Rate | VPC | Cognito plan | Est. Cost |
|--------|--------|---------|----------|-----|--------------|-----------|
| nano | 128 MB | 10s | 10/s | No | lite | ~$5–15/mo |
| micro | 256 MB | 10s | 50/s | Yes | lite | ~$30–80/mo |
| medium | 512 MB | 15s | 100/s | Yes | essentials | ~$100–300/mo |
| large | 1024 MB | 30s | 500/s | Yes | essentials | ~$500+/mo |
import { getPreset, PRESET_NANO } from '@venturekit/core';
const preset = getPreset('nano'); // Returns full PresetConfigCognito feature plan
The plan is the User Pool's per-MAU billing tier. nano and micro
use lite ($0.0055/MAU, 10,000 MAU free), which covers everything
VentureKit provisions on a pool — password + SRP auth, federation,
SMS/TOTP MFA, custom attributes, Lambda triggers. medium and large
use essentials ($0.015/MAU beyond the same 10,000 free MAUs),
which adds managed login branding, passwordless sign-in (email/SMS
OTP, passkeys), email MFA, access-token customization and
password-reuse prevention.
No preset picks plus ($0.020/MAU, no free tier, billed across the
whole pool) for you, at any size — it buys threat protection:
compromised-credentials detection, adaptive auth, and exportable auth
logs. Opt into it, or pin a stage back to a cheaper tier, per stage:
const prod: EnvConfigInput = {
preset: 'medium',
identity: { featurePlan: 'plus' }, // turn threat protection on
};Config Resolution
import { resolveConfig } from '@venturekit/core';
const resolved = resolveConfig(base, 'dev', devEnvInput);
// Returns a fully resolved ResolvedConfig with no undefined valuesValidation
import { validateBaseConfig, assertValid } from '@venturekit/core';
const result = validateBaseConfig(base);
assertValid(result); // Throws if invalidInfrastructure Intents
Declare what infrastructure you need without provider-specific details:
import type { VentureIntent } from '@venturekit/core';
const infrastructure: VentureIntent = {
databases: [{ id: 'main', type: 'postgres', size: 'small', name: 'mydb' }],
storage: [{ id: 'uploads', purpose: 'uploads', cdn: true }],
queues: [{ id: 'jobs', type: 'standard', deadLetterQueue: true }],
caches: [{ id: 'sessions', type: 'redis', size: 'small' }],
schedules: [{ id: 'cleanup', handler: 'src/jobs/cleanup.handler', schedule: { rate: '1 day' } }],
};API Reference
See the API reference for full type documentation.
License
Apache-2.0 — see LICENSE for details.
