Manifest management for the Svelte SDK
Developer preview
This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.
warning
SvelteKit requires downloading the manifest locally. The manifest must be imported as a JSON file and provided to the Context instance in the root layout.
Add these scripts to your package.json:
{
"scripts": {
"dev": "npm run pull:manifest && vite dev",
"build": "npm run pull:manifest && vite build",
"pull:manifest": "uniform context manifest download --output ./src/lib/uniform/contextManifest.json",
"pull:content": "uniform sync pull",
"push:content": "uniform sync push",
"publish:manifest": "uniform context manifest publish"
}
}
| Script | Description |
|---|---|
pull:manifest | Downloads the personalization manifest to a local JSON file |
pull:content | Pulls content definitions from your Uniform project |
push:content | Pushes local content changes to your Uniform project |
publish:manifest | Publishes the manifest (required after changing signals, enrichments, or quirks) |
Create a placeholder manifest file at src/lib/uniform/contextManifest.json:
{
"project": {}
}
Add contextManifest.json to src/lib/uniform/.gitignore since it is auto-generated.
Uniform CLI configuration#
Create uniform.config.ts at your project root:
// uniform.config.ts
import { uniformConfig } from '@uniformdev/cli/config';
export default uniformConfig({
preset: 'all',
disableEntities: ['webhook'],
});
A SvelteKit app has "type": "module" in package.json, so this file uses export default.