Anima Upgrade & Migration
Migration Paths
| From |
To |
Complexity |
| Figma plugin (manual) |
SDK automation |
Medium |
| SDK v1 → v2 |
SDK latest |
Low |
| Anima Playground |
SDK API |
Low |
Instructions
Step 1: Upgrade SDK
# Check current version
npm list @animaapp/anima-sdk
# Upgrade to latest
npm install @animaapp/anima-sdk@latest
# Check for breaking changes
npm info @animaapp/anima-sdk changelog
Step 2: Migrate from Manual Plugin to SDK
// BEFORE: Manual Figma plugin workflow
// 1. Open Figma → Plugins → Anima
// 2. Select component → Export → React
// 3. Copy-paste generated code into project
// 4. Manually repeat for each component change
// AFTER: Automated SDK workflow
import { Anima } from '@animaapp/anima-sdk';
const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });
// Automated: runs in CI on Figma file version change
async function syncDesignToCode() {
const { files } = await anima.generateCode({
fileKey: process.env.FIGMA_FILE_KEY!,
figmaToken: process.env.FIGMA_TOKEN!,
nodesId: ['1:2', '3:4', '5:6'], // All design system components
settings: { language: 'typescript', framework: 'react', styling: 'tailwind' },
});
// Write to project, run through linter, create PR
for (const file of files) {
require('fs').writeFileSync(`src/components/generated/${file.fileName}`, file.content);
}
}
Step 3: API Changes Checklist
// Common API changes between versions:
// - New settings options (e.g., uiLibrary: 'shadcn' added later)
// - New frameworks (e.g., Next.js-specific output)
// - Response format changes in files array
// - New authentication methods
// Test after upgrade:
async function testUpgrade() {
const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });
const { files } = await anima.generateCode({
fileKey: process.env.FIGMA_FILE_KEY!,
figmaToken: process.env.FIGMA_TOKEN!,
nodesId: ['1:2'],
settings: { language: 'typescript', framework: 'react', styling: 'tailwind' },
});
console.log(`Upgrade test: ${files.length} files generated`);
}
Output
- SDK upgraded to latest version
- Migrated from manual plugin to automated SDK
- All generation tests passing after upgrade
Resources
Next Steps
For CI/CD setup, see anima-ci-integration.
1---2name: anima-upgrade-migration3description: |4 Upgrade @animaapp/anima-sdk versions and handle API changes.5 Use when upgrading SDK versions, migrating from the Figma plugin workflow6 to SDK-based automation, or adapting to new Anima API features.7 Trigger: "anima upgrade", "anima migration", "anima SDK update".8allowed-tools: Read, Write, Edit, Bash(npm:*), Grep9version: 1.0.010license: MIT11author: Jeremy Longshore <jeremy@intentsolutions.io>12tags: [saas, design, figma, anima, migration]13compatible-with: claude-code14---1516# Anima Upgrade & Migration1718## Migration Paths1920| From | To | Complexity |21|------|----|-----------|22| Figma plugin (manual) | SDK automation | Medium |23| SDK v1 → v2 | SDK latest | Low |24| Anima Playground | SDK API | Low |2526## Instructions2728### Step 1: Upgrade SDK2930```bash31# Check current version32npm list @animaapp/anima-sdk3334# Upgrade to latest35npm install @animaapp/anima-sdk@latest3637# Check for breaking changes38npm info @animaapp/anima-sdk changelog39```4041### Step 2: Migrate from Manual Plugin to SDK4243```typescript44// BEFORE: Manual Figma plugin workflow45// 1. Open Figma → Plugins → Anima46// 2. Select component → Export → React47// 3. Copy-paste generated code into project48// 4. Manually repeat for each component change4950// AFTER: Automated SDK workflow51import { Anima } from '@animaapp/anima-sdk';5253const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });5455// Automated: runs in CI on Figma file version change56async function syncDesignToCode() {57 const { files } = await anima.generateCode({58 fileKey: process.env.FIGMA_FILE_KEY!,59 figmaToken: process.env.FIGMA_TOKEN!,60 nodesId: ['1:2', '3:4', '5:6'], // All design system components61 settings: { language: 'typescript', framework: 'react', styling: 'tailwind' },62 });6364 // Write to project, run through linter, create PR65 for (const file of files) {66 require('fs').writeFileSync(`src/components/generated/${file.fileName}`, file.content);67 }68}69```7071### Step 3: API Changes Checklist7273```typescript74// Common API changes between versions:75// - New settings options (e.g., uiLibrary: 'shadcn' added later)76// - New frameworks (e.g., Next.js-specific output)77// - Response format changes in files array78// - New authentication methods7980// Test after upgrade:81async function testUpgrade() {82 const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });83 const { files } = await anima.generateCode({84 fileKey: process.env.FIGMA_FILE_KEY!,85 figmaToken: process.env.FIGMA_TOKEN!,86 nodesId: ['1:2'],87 settings: { language: 'typescript', framework: 'react', styling: 'tailwind' },88 });89 console.log(`Upgrade test: ${files.length} files generated`);90}91```9293## Output9495- SDK upgraded to latest version96- Migrated from manual plugin to automated SDK97- All generation tests passing after upgrade9899## Resources100101- [Anima SDK npm](https://www.npmjs.com/package/@animaapp/anima-sdk)102- [Anima SDK GitHub](https://github.com/AnimaApp/anima-sdk)103104## Next Steps105106For CI/CD setup, see `anima-ci-integration`.107