replit-sdk-patterns

Featured

Apply production-ready patterns for Replit Database, Object Storage, and Auth APIs. Use when implementing Replit integrations, structuring data access layers, or establishing team coding standards for Replit services. Trigger with phrases like "replit patterns", "replit best practices", "replit code patterns", "idiomatic replit", "replit SDK".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Replit SDK Patterns ## Overview Production-ready patterns for Replit's built-in services: Key-Value Database (`@replit/database` / `replit.db`), Object Storage (`@replit/object-storage`), PostgreSQL (`DATABASE_URL`), and Auth headers. Covers singleton clients, error handling, and type-safe wrappers. ## Prerequisites - `.replit` and `replit.nix` configured (see `replit-install-auth`) - Familiarity with async/await patterns - Understanding of Replit's service model ## Instructions ### Step 1: Database Client Singleton (Node.js) ```typescript // src/db/kv.ts — Replit Key-Value Database wrapper import Database from '@replit/database'; let instance: Database | null = null; export function getKV(): Database { if (!instance) { instance = new Database(); } return instance; } // Type-safe KV operations export async function kvGet<T>(key: string): Promise<T | null> { const value = await getKV().get(key); return value as T | null; } export async function kvSet<T>(key: string, value: T): Promise<void> { await getKV().set(key, value); } export async function kvList(prefix = ''): Promise<string[]> { return getKV().list(prefix); } export async function kvDelete(key: string): Promise<void> { await getKV().delete(key); } // Limits: 50 MiB total, 5,000 keys, 1 KB/key, 5 MiB/value ``` ### Step 2: Object Storage Wrapper ```typescript // src/storage/objects.ts — Replit App Storage (Object Storage) import { Client } from '@replit/object-storage'; let storage: Cli...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category