@venturekit/core
v0.0.0-dev.20260507015944
Published
VentureKit core types, presets, and configuration resolution.
Downloads
12,493
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, security, environment)
- Presets for quick environment sizing (
nano,micro,medium,large) - Configuration resolution that merges base + security + 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 |
| SecurityConfig | OAuth scopes, app clients | No |
| EnvConfigInput | Resource sizing, scaling | Yes |
Base Config
import type { BaseConfig } from '@venturekit/core';
const base: BaseConfig = {
name: 'my-api',
displayName: 'My API',
region: 'eu-west-1',
};Security Config
import type { SecurityConfig } from '@venturekit/core';
const security: SecurityConfig = {
scopes: [
{ name: 'api.read', description: 'Read API data' },
{ name: 'api.write', description: 'Write API data' },
],
appClients: [
{
name: 'web-app',
allowedScopes: ['api.read', 'api.write'],
supportsRefreshTokens: true,
},
],
};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 | Est. Cost |
|--------|--------|---------|----------|-----|-----------|
| nano | 128 MB | 10s | 10/s | No | ~$5–15/mo |
| micro | 256 MB | 10s | 50/s | Yes | ~$30–80/mo |
| medium | 512 MB | 15s | 100/s | Yes | ~$100–300/mo |
| large | 1024 MB | 30s | 500/s | Yes | ~$500+/mo |
import { getPreset, PRESET_NANO } from '@venturekit/core';
const preset = getPreset('nano'); // Returns full PresetConfigConfig Resolution
import { resolveConfig } from '@venturekit/core';
const resolved = resolveConfig(base, security, 'dev', devEnvInput);
// Returns a fully resolved ResolvedConfig with no undefined valuesValidation
import { validateBaseConfig, validateSecurityConfig, 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.
