Skip to main content

Install from npm

Both packages are published on npm as @cskn/sdk and @cskn/ui. Install them together with their peer dependencies:
@cskn/ui builds on @cskn/sdk, so install the SDK even if you only use the UI kit. If you only need the SDK, leave out @cskn/ui.
The version on npm today, 0.0.1, is a placeholder that exports nothing. It reserves the package names. The first usable release will be 0.1.0. Until it is out, use Install from source below.

Peer dependencies

Your app provides these, so there is a single copy of each:

Install from source

Until the first release on npm, the packages are consumed from source through a bundler and TypeScript alias. create-cskn-app sets this up for you; the steps below are for adding them to a project by hand. You still need the peer dependencies.

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.