Releases: AnimaApp/anima-sdk
v0.17.0
v0.16.1
v0.16.0
v0.14.0
No breaking changes have been introduced in this version, so upgrading from v0.13.0 to v0.14.0 will require no changes on your side.
What changed
- New UI Library supported! You can now set
uiLibrary: 'custom_design_system'for users that have configured a custom design system, with Anima, for their team.
v0.13.0
No breaking changes have been introduced in this version, so upgrading from v0.12.0 to v0.13.0 will require no changes on your side.
What's new
- Now, it's possible to re-attach to an existing job from the client-side. Use the new function
attachJobfor that.
v0.12.0
No breaking changes have been introduced in this version, so upgrading from v0.11.0 to v0.12.0 will require no changes on your side.
What's new
- We improved the TypeScript typing for the SSE messages (
SSECommonMessage,SSEGetCodeFromFigmaMessage,SSEGetCodeFromWebsiteMessageandSSEGetCodeFromPromptMessage) (#69)
v0.11.0
No breaking changes have been introduced in this version, so upgrading from v0.10.0 to v0.11.0 will require no changes on your side.
What's new
- This version adds the error
FileNotExportable. Now, when the Figma file is set as not exportable by viewers (see image below), this error is thrown in place ofUnknownForbiddenFigmaError. You can check for this error if you want to provide better error messages.

v0.10.0
No breaking changes have been introduced in this version, so upgrading from v0.9.0 to v0.10.0 will require no changes on your side.
What's new
- We introduced the ability to import websites via a hosted MHTML payload, rather than a MHTML payload directly. This simplifies importing larger MHTML payloads when using the
generateCodeFromWebsitemethod, as you can host them and then provide a URL to Anima to start the generation.
v0.9.0
Upgrading from v0.8.0 to v0.9.0 requires a few changes if you are relying on some error classes that were renamed or removed.
The main update in v0.9.0 is providing better support for error handling when the Figma user's token expires or is invalidated (e.g., was revoked).
What's new
onForbiddenoption onFigmaRestApi: callback called when a 403 Forbidden error is received from the Figma API. It receives an instance ofNeedsReauthFigmaToken,ExpiredFigmaTokenorUnknownForbiddenFigmaErroras an argument. Check the readme to learn how to handle these errors properly.
Breaking changes
InvalidFigmaTokenwas renamed withMalformattedFigmaTokenFigmaTokenIssuewas removed in favor of more granular errors:NeedsReauthFigmaToken,ExpiredFigmaTokenandUnknownForbiddenFigmaError.- The undocumented function
getFigmaApiErrorTypewas removed
Other changes
- Add
figmaRestApi.getMe()method. See Figma documentation for the/v1/meendpoint. - Add
figmaRestApi.hasDefaultToken()method to check if a default token is set.
For full details, see the README.
v0.8.0
Upgrading from v0.7.x to v0.8.0 requires a few changes.
The main update in v0.8.0 is support for the new Figma API rate limit, which takes effect on November 17.
What's new
FigmaRestApi: A utility class for retrieving data from Figma for code generation. It was designed to handle rate limits automatically.
Breaking changes
<AnimaSdkProvider />now requires a new prop:figmaRestApi- The hook
useFigmaFilemust now be called within<AnimaSdkProvider /> - The following styling options were removed from
CodegenSettings:"css_modules" | "styled_components" | "sass" | "scss"
Minor changes
- The type
ProgressMessagewas updated, adding the propertytype: "info" | "rate_limit"
Migration steps
The main step to migrate from v0.7.x to v0.8.0 is to create an instance of FigmaRestApi and pass it to <AnimaSdkProvider />
1 - Create an instance of FigmaRestApi:
import { FigmaRestApi } from "@animaapp/anima-sdk";
const figmaRestApi = new FigmaRestApi({
defaultOptions: { // Optional.
token: "Figma Token", // Must start with `figd_` or `figu_`
},
});2 - Pass it to <AnimaSdkProvider />:
<AnimaSdkProvider
figmaRestApi={figmaRestApi}
...For full details, see the README.
Testing
You can test the new progress messages for rate limiting using the following Figma file key:
- Short rate limit: Use
Y1TdquDVUkEVetLzKOXAp8to simulate a 10-second wait. - Rate limit exceeded: Use
AwhyxD3hSAcPDxedRjckbsto trigger a rate limit exceeded exception. It'll abort the code generation.