Skip to content

Installation

Requirements

routekit requires Node 18+ for development and a browser that supports the History API (every browser since 2014). It works with any frontend renderer — React, Preact, Solid, Vue, or vanilla.

Install

Terminal window
npm install routekit

routekit ships ESM and CJS bundles plus full TypeScript declarations. There is no peer dependency on a UI framework.

Verify the install

Create a tiny test file in your project:

scripts/check-routekit.ts
import { createRouter } from 'routekit';
const r = createRouter([{ path: '/', handler: () => 'ok' }]);
console.log(r.match('/')); // → { handler: …, params: {} }

Run it with your runner of choice. If you see { handler: ..., params: {} }, the install is good.

Next steps

Continue to the quickstart for a working router in 10 lines, or jump to your first route for a deeper walkthrough.