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| Before | Primitree 1.0 |
|---|---|
@figma-vars/hooks | @primitree/hooks |
@figma-vars/hooks/core | @primitree/core |
| Hooks variables exporter | primitree 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,useThemefor built DTCG artifacts- Packages for core utilities, DTCG output, the CLI, and MCP use the
@primitreenamespace - The CLI includes
build,diff,check,init, andexport
Live API hooks
Update the dependency and imports. Confirm the Node and React requirements and run the application's tests.
Adopt local tokens
- Run
primitree build variables.json - Import JSON + resolver in
TokensProvider - 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.