X Framework

The modern Node.js framework that embraces ecosystem freedom

Use any database, auth, or API layer you love - X adapts to your stack, not the other way around

x.ts
import { createX } from '@xframework/x';
 
export const x = createX()
  .syncAdapter('hono', () => new HonoAdapter(hono))
  .syncAdapter('db', () => new DrizzleAdapter(drizzle))
  .syncAdapter('stripe', () => new StripeAdapter(stripe))
  .syncAdapter('auth', () => new BetterAuthAdapter(auth))
  .syncAdapter('logger', () => new LogTapeAdapter(logTape));
 
// USAGE
export async function GET(request: Request) {
  const user = await x.auth.getUser(request);
  x.logger.info('Fetching posts for user', { user });
  const posts = await x.db.query.posts.findMany({
    where: eq(posts.authorId, user.id),
  });
 
  return new Response(JSON.stringify({
    posts,
  }));
}