Skip to content
LogoLogo

How to install the Vite plugin

This guide shows you how to embed your project configuration at build time, so the SDK makes no API request at runtime.

1. Install

2. Name your project

Create picked.config.ts in the root of your project. The plugin reads your project identity from this file:

import { defineConfig } from 'picked/config'
 
export default defineConfig({
  projectId: 'your-project-id',
})

3. Add the plugin to your Vite config

import { defineConfig } from 'vite'
import { picked } from '@picked/vite-plugin-picked'
 
export default defineConfig({
  plugins: [picked()],
})

When Vite starts, the plugin reads your project configuration and embeds them in your bundle. The SDK then reads the embedded configuration and makes no network request.

The plugin also writes picked-env.d.ts, which types your fields, features and steps against the workspace. See Type generation.