Skip to main content

Vibe Storage

GenKit includes a pluggable storage system for persisting user-generated components. Use the built-in Prisma adapter, or create your own for any database.

Quick Start

Prisma Setup

1. Add the Model

Add this to your schema.prisma:

2. Run Migration

3. Create the API

API Reference

vibe.save(input)

Save a new component.

vibe.load(id)

Load a component by ID.

vibe.list(options)

List components for a user.

vibe.delete(id)

Delete a component.

Memory Storage (Testing)

For development and testing, use in-memory storage:
Memory storage is cleared when the server restarts. Only use for development.

Custom Storage Adapter

Implement the VibeStorage interface for custom backends:

Drizzle Example

API Routes

Save Component

List Components

Load Component

Component Types

Next Steps

VibeFrame

Render saved components securely

Compiler

Validate code before saving