---
title: "Introducing Prisma Standalone Types: Copy Your Database Types Anywhere"
slug: "prisma-standalone-types-announcement"
published: "2025-09-17"
updated: "2025-09-17"
categories:
  - "Tools"
tags:
  - "Prisma"
  - "TypeScript"
  - "types"
  - "JSON Schema"
  - "SDK"
  - "interfaces"
  - "schema generation"
audience-level: "beginner"
llm-purpose: "Generate dependency-free TypeScript interfaces from your Prisma schema with prisma-standalone-types. Share types across frontend, microservices."
llm-prereqs:
  - "Prisma"
  - "TypeScript"
  - "prisma-json-schema-generator"
---

**Summary Triples**
- (Introducing Prisma Standalone Types: Copy Your Database Types Anywhere, expresses-intent, reference)
- (Introducing Prisma Standalone Types: Copy Your Database Types Anywhere, covers-topic, Prisma)
- (Introducing Prisma Standalone Types: Copy Your Database Types Anywhere, provides-guidance-for, Generate dependency-free TypeScript interfaces from your Prisma schema with prisma-standalone-types. Share types across frontend, microservices.)

### {GOAL}
Generate dependency-free TypeScript interfaces from your Prisma schema with prisma-standalone-types. Share types across frontend, microservices.

### {PREREQS}
- Prisma
- TypeScript
- prisma-json-schema-generator

### {STEPS}
1. Follow the detailed walkthrough in the article content below.

<!-- llm:goal="Generate dependency-free TypeScript interfaces from your Prisma schema with prisma-standalone-types. Share types across frontend, microservices." -->
<!-- llm:prereq="Prisma" -->
<!-- llm:prereq="TypeScript" -->
<!-- llm:prereq="prisma-json-schema-generator" -->

# Introducing Prisma Standalone Types: Copy Your Database Types Anywhere
> Generate dependency-free TypeScript interfaces from your Prisma schema with prisma-standalone-types. Share types across frontend, microservices.
Matija Žiberna · 2025-09-17

I had a problem. I was working with Prisma across multiple projects and needed to share database types between them. The regular Prisma client comes with all its dependencies and runtime overhead. What I really wanted was just the clean TypeScript interfaces I could copy anywhere.

## The Problem

When you use Prisma, you get fantastic type safety. But those types are tied to the Prisma client. If you want to use the same types in:

* Your frontend React app
* A separate microservice  
* A shared utility library
* Another project entirely

You're stuck. You either duplicate type definitions manually or import the entire Prisma client just for types. Neither solution felt right.

## The Solution

I built `prisma-standalone-types`. It generates clean TypeScript interfaces from your Prisma schema with zero dependencies. You can copy these types anywhere and they just work.

Here's what it does:

1. Reads your existing Prisma schema
2. Generates JSON Schema using prisma-json-schema-generator  
3. Converts that to clean TypeScript interfaces
4. Outputs a file you can copy to any project

## Example

Your Prisma schema:

```prisma
enum UserRole {
  ADMIN
  USER
}

model User {
  id        String   @id @default(uuid())
  name      String
  email     String?
  role      UserRole @default(USER)
  createdAt DateTime @default(now())
}
```

Generated output:

```typescript
export enum UserRole {
  ADMIN = 'ADMIN',
  USER = 'USER',
}

export interface User {
  id: string;
  name: string;
  email?: string | null;
  role: UserRole;
  createdAt: Date;
}
```

Perfect. Clean. No dependencies.

## How to Use It

Install the package:

```bash
npm install --save-dev prisma-standalone-types
```

Make sure your `prisma/schema.prisma` includes the JSON schema generator:

```prisma
generator jsonSchema {
  provider = "prisma-json-schema-generator"
  output   = "../types"
}
```

Generate your types:

```bash
npx prisma-standalone-types --output types/database.ts
```

That's it. Copy the generated file anywhere you need those types.

## Why This Matters

Type safety shouldn't stop at project boundaries. With standalone types, you can:

* Share types between frontend and backend
* Use the same types in multiple microservices
* Keep types in sync across your entire stack
* Avoid runtime dependencies when you just need types

The generated files are completely self contained. No imports, no dependencies, just pure TypeScript interfaces you can use anywhere.

## Get Started

The package is available on npm and the source code is on GitHub.

**Links:**
* npm: https://www.npmjs.com/package/prisma-standalone-types
* GitHub: https://github.com/matija2209/prisma-standalone-types
* Documentation: Full README with examples and options

I built this because I needed it. Hopefully it solves the same problem for you. The package handles all the complex JSON Schema to TypeScript conversion automatically. You just run one command and get clean, copyable types.

Try it out and let me know what you think. Issues and contributions welcome on GitHub.

---

*Built with ❤️ for the Prisma community*