Skip to main content
Version: 2.0.0

Installation

Automatic Installation

  1. Add integration:
npx astro add astro-typesafe-routes
  1. Start the Astro development server if it's not already running to run type generation:
npm run dev

Manual Installation

  1. Install Typescript if it's not already installed.
npm i -D typescript
  1. Install package:
npm install -D astro-typesafe-routes
  1. Add integration to astro.config.mjs:
import { defineConfig } from 'astro/config';
import astroTypesafeRoutes from "astro-typesafe-routes"

export default defineConfig({
integrations: [
astroTypesafeRoutes()
]
});
  1. Start the Astro development server if it's not already running to run code generation:
npm run dev