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,266 stars 315 forks Updated today 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
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

replit-data-handling

Implement secure data handling on Replit: PostgreSQL, KV Database, Object Storage, and data security patterns. Use when handling sensitive data, connecting databases, implementing data access patterns, or ensuring secure data flow in Replit-hosted applications. Trigger with phrases like "replit data", "replit database", "replit PostgreSQL", "replit storage", "replit data security", "replit GDPR".

2,266 Updated today
jeremylongshore
AI & Automation Featured

replit-reliability-patterns

Implement reliability patterns for Replit: cold start handling, graceful shutdown, persistent state, and keep-alive. Use when building fault-tolerant Replit apps, handling container restarts, or adding resilience to production Replit deployments. Trigger with phrases like "replit reliability", "replit container restart", "replit data persistence", "replit always on", "replit graceful shutdown".

2,266 Updated today
jeremylongshore
AI & Automation Featured

replit-reference-architecture

Implement Replit reference architecture with best-practice project layout, data layer, and deployment. Use when designing new Replit apps, reviewing project structure, or establishing architecture standards for production Replit applications. Trigger with phrases like "replit architecture", "replit best practices", "replit project structure", "how to organize replit", "replit production layout".

2,266 Updated today
jeremylongshore
AI & Automation Featured

klaviyo-sdk-patterns

Apply production-ready Klaviyo SDK patterns for the klaviyo-api package. Use when implementing Klaviyo integrations, refactoring SDK usage, or establishing team coding standards for Klaviyo API calls. Trigger with phrases like "klaviyo SDK patterns", "klaviyo best practices", "klaviyo code patterns", "idiomatic klaviyo", "klaviyo wrapper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

replit-rate-limits

Handle Replit resource limits: KV database caps, deployment quotas, and request throttling. Use when hitting storage limits, managing deployment resources, or implementing rate limiting in your Replit-hosted app. Trigger with phrases like "replit rate limit", "replit throttling", "replit 429", "replit storage limit", "replit quota".

2,266 Updated today
jeremylongshore