Primitree

Migration from @figma-vars/hooks

Replace @figma-vars/hooks with @primitree/hooks 1.0.

Primitree 1.0 moves the hooks package from @figma-vars/hooks to @primitree/hooks. The package requires Node.js 24 or newer, React ^19.0.0, and SWR ^2.3.7.

Replace packages and imports

npm uninstall @figma-vars/hooks
npm install @primitree/hooks@next
BeforePrimitree 1.0
@figma-vars/hooks@primitree/hooks
@figma-vars/hooks/core@primitree/core
Hooks variables exporterprimitree export from @primitree/cli

Import FigmaVariablesProvider from @primitree/hooks and update both JSX tags. Primitree exports no alias for the former provider name.

New in 1.0

  • TokensProvider, useToken, useTokens, useTheme for built DTCG artifacts
  • Packages for core utilities, DTCG output, the CLI, and MCP use the @primitree namespace
  • The CLI includes build, diff, check, init, and export

Live API hooks

Update the dependency and imports. Confirm the Node and React requirements and run the application's tests.

Adopt local tokens

  1. Run primitree build variables.json
  2. Import JSON + resolver in TokensProvider
  3. Replace hard-coded colors with useToken('path.to.token')

Export variables through the CLI

Install @primitree/cli and run primitree export to download local Figma variables JSON. Pass that JSON to primitree build to create token output. The hooks package no longer ships an export executable.

Read the @primitree/hooks changelog for the release history.