Skip to main content

Installation

Kysely can be installed using any major JavaScript package manager. Choose your preferred package manager below.

Package Manager Installation

Database Driver Installation

Kysely requires a database driver to connect to your database. Install the appropriate driver for your database:
For TypeScript users, you may also want to install @types/pg as a dev dependency.

Deno Installation

For Deno users, add Kysely to your deno.json imports:
deno.json
Replace version numbers with the latest versions. Deno uses different driver imports than Node.js.

TypeScript Configuration

Kysely requires TypeScript 4.6 or later. Ensure your tsconfig.json has these settings:
tsconfig.json
The strict flag is highly recommended to get the full benefits of Kysely’s type-safety.

Verify Installation

Create a simple test file to verify your installation:
test.ts
Run the file:

Next Steps

Quick Start

Set up your database and write your first query

Type Generation

Learn how to generate types from your database schema

Version Compatibility

Current Version: 0.28.xNode.js: Requires Node.js 20.0.0 or laterTypeScript: Requires TypeScript 4.6 or later
For users on older TypeScript versions (< 4.6), Kysely provides compatibility type definitions, but upgrading TypeScript is strongly recommended for the best experience.