loadRemote is fully typed. No bundler plugin is required at any step.
1
Install packages
Install the runtime as a regular dependency and the CLI as a dev dependency. Add optional packages only as you need them.
2
Create knit.config.json for the remote
In your remote application’s root directory, create a
knit.config.json file. The name field becomes the prefix consumers use in loadRemote. The shared array lists packages that should resolve to a single instance across the host and all remotes. The exposes array lists the entry points this remote makes available.knit.config.json
The
name field must be lowercase and match the pattern [a-z][a-z0-9_-]*. It is used as the prefix in loadRemote("checkout/CartWidget") — the host uses this exact string to address your remote.3
Build the remote
Run the knitkit build command from your remote’s root directory. The CLI bundles each shared dependency from The output lands in Serve the This emits
node_modules into an individual ESM file, bundles each exposed entry point, and writes a manifest with SRI integrity hashes.dist/ with this structure:dist/ directory from any static host, CDN, or local dev server. All URLs in the manifest are relative to the manifest’s own URL, so the remote is portable across environments without rebuilding.To generate TypeScript declarations alongside the manifest, run:dist/types/*.d.ts and records each types URL inside the manifest so knitkit types sync on the host side can download them automatically.4
Load the remote from a host
The one hard rule when loading remotes in the browser: inject the import map before the first module import that resolves through it. Use a small bootstrap script at the top of your HTML to register remotes and inject the map, then dynamically import the rest of your application.After bootstrapping, call If you are using React, use
index.html
loadRemote anywhere in your application code:src/main.ts
<RemoteComponent> from @knitkit/react instead. It handles lazy loading, Suspense, and error boundaries automatically.src/App.tsx
5
Type your remotes
Create a Run the sync command to download each remote’s Finally, add the types directory to your After syncing,
knit.host.json file in the host project’s root. This tells the CLI which remote manifests to fetch types from and where to write the downloaded declarations.knit.host.json
.d.ts files and generate a module augmentation that makes loadRemote fully typed:tsconfig.json so TypeScript picks up the augmentations:tsconfig.json
loadRemote("checkout/CartWidget") returns the exact type of that component’s default export — full autocomplete and type checking, no manual declarations needed.