Skip to main content
Both packages are currently consumed from source, through a bundler and TypeScript alias, rather than installed from the npm registry. create-cskn-app sets this up for you. The steps below are for adding them to a project by hand.

Peer dependencies

The host app provides these. Install them in your app:

Vite alias

Point both package names at their src folders, and dedupe the shared libraries so the app and the packages use one copy of each:
vite.config.ts
Leaving out dedupe gives you two copies of React or TanStack Query. The usual symptom is an “invalid hook call” error, or queries that never share a cache.

TypeScript paths

tsconfig.json

Asset base vs. router base

base: '/<slug>/' in Vite is where your assets are served from, and it is correct on every host. Where your router is mounted is not something the build can know: the same bundle is served at the root of <slug>.cskn.app and under /<slug> on a creator’s page. Pass appBasename() to your router instead of hard-coding it:
See URLs and routing for the details.