replacebase

Replacebase integration skill for migrating away from Supabase. Use this skill when setting up Replacebase, configuring a Supabase-compatible backend, or migrating from Supabase to self-hosted infrastructure. Triggers on tasks involving Supabase migration, Replacebase setup, or replacing Supabase services with self-hosted alternatives.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "replacebase" with this command: npx skills add specific-dev/replacebase/specific-dev-replacebase-replacebase

Replacebase

Replacebase is a TypeScript library that serves as a drop-in replacement for Supabase's backend. It wraps your Postgres database and S3 storage, and exposes a Supabase-compatible API. This means you don't have to change any frontend logic and can unify all your backend code for a simpler architecture.

When to Apply

  • Setting up a new Replacebase instance to replace Supabase
  • Migrating an existing app from Supabase to self-hosted infrastructure
  • Configuring REST API, Auth, Storage, or Realtime to work with Replacebase
  • Updating @supabase/supabase-js client config to point at Replacebase
  • Choosing a hosting provider or framework integration for Replacebase

What Replacebase Supports

ServiceDescription
REST APIPostgREST-compatible CRUD against any Postgres DB
AuthGoTrue-compatible auth API, built on Better Auth
StorageS3-compatible file storage
RealtimeBroadcast and presence over WebSockets

Installation

npm install @specific.dev/replacebase

Setup

1. Gather Supabase Details

You need the following from your Supabase project:

  1. Postgres connection string — click "Connect" in the Supabase dashboard top bar
  2. JWT Signing Key URL — go to Settings > JWT Keys > View key details > Discovery URL
  3. Legacy JWT secret — go to Settings > JWT Keys > Legacy JWT Secret
  4. S3 connection details (if using storage) — go to Storage > S3

2. Initialize Replacebase

// server.ts
import { createReplacebase } from "replacebase";

const replacebase = await createReplacebase({
  databaseUrl: process.env.DATABASE_URL!, // Supabase Postgres connection string
  jwksUrl: process.env.JWKS_URL!, // Supabase JWT Signing Key URL
  jwtSecret: process.env.JWT_SECRET!, // Supabase JWT secret
  // If using storage, pass Supabase S3 details
  storage: {
    s3: {
      endpoint: process.env.S3_ENDPOINT!,
      region: process.env.S3_REGION!,
      accessKeyId: process.env.S3_ACCESS_KEY_ID!,
      secretAccessKey: process.env.S3_SECRET_ACCESS_KEY!,
    },
  },
});

3. Serve with Your Framework

Replacebase is framework-agnostic. Pick whichever fits your stack:

Next.js:

Since Next.js catch-all routes are mounted under a subpath, use the basePath option so Replacebase matches routes correctly:

// app/api/[...path]/route.ts
const replacebase = await createReplacebase({
  // ...
  basePath: "/api",
});

export const GET = replacebase.fetch;
export const POST = replacebase.fetch;
export const PUT = replacebase.fetch;
export const PATCH = replacebase.fetch;
export const DELETE = replacebase.fetch;

Note: Next.js API routes don't support WebSockets, so Realtime won't work with this setup. If you need Realtime, run Replacebase as a separate backend service.

Express:

import express from "express";

const app = express();
app.all("/*", replacebase.toNodeHandler());
const server = app.listen(3000);
replacebase.injectWebSocket(server); // Enables Realtime (broadcast + presence)

Hono / Bun / Deno / Cloudflare Workers (standard fetch):

export default { fetch: replacebase.fetch };

For Realtime support on Node.js, use @hono/node-server to get an HTTP server you can inject WebSockets into:

import { serve } from "@hono/node-server";

const server = serve({ fetch: replacebase.fetch, port: 3000 });
replacebase.injectWebSocket(server);

4. Update Client Config

The only frontend change is pointing the Supabase client at your Replacebase server:

import { createClient } from "@supabase/supabase-js";

const supabase = createClient(
  "https://your-replacebase-server.com", // Your Replacebase URL
  "your-anon-key",
);

Configuration Reference

OptionTypeRequiredDescription
databaseUrlstringYesPostgres connection string
jwtSecretstringYesSupabase legacy JWT secret (HS256 signing key)
jwksUrlstringNoSupabase JWT Signing Key URL (JWKS endpoint)
storageobjectNoS3-compatible storage configuration
basePathstringNoBase path prefix if served from a subpath (e.g. "/api")

Exported API

ExportTypeDescription
replacebase.fetch(Request) => Promise<Response>Web Standard fetch handler
replacebase.toNodeHandler()(req, res) => voidNode.js HTTP handler (Express, Fastify)
replacebase.injectWebSocket(server)(server) => voidAttach Realtime WebSocket to HTTP server
replacebase.appHonoRaw Hono instance for advanced usage
generateKeys(jwtSecret)Promise<{ anonKey, serviceRoleKey }>Generate API keys from JWT secret

Migration Path

Once Replacebase is running, you can gradually:

  1. Change Postgres provider — move to AWS RDS, Neon, or any Postgres host. Update databaseUrl and your frontend keeps working.
  2. Change storage provider — switch to AWS S3, Cloudflare R2, or any S3-compatible service. Migrate files with rclone and update credentials.
  3. Migrate away from the Supabase SDK — build regular backend endpoints alongside Replacebase. Replace supabase.from("posts").select() calls with your own API. Eventually drop @supabase/supabase-js entirely.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated