Builder.io SDKs and Tools
repository·main·Indexed 27 days ago
https://github.com/builderio/builderA visual development platform to turn Figma designs into code and manage content via a drag-and-drop editor. This repository includes the Admin API SDK (@builder.io/admin-sdk), Android SDK for Jetpack Compose, Angular SDK (@builder.io/angular), Core SDK (@builder.io/sdk), and a CLI for space management and Next.js integration. It also provides the create-builder.io project initializer and tools for Figma synchronization and fiddle embedding.
What's inside Builder.io
- The SFCC Sync plugin enables a connection between your Builder.io instance and your Salesforce Commerce Cloud instance. It allows you to synchronize the content of any Builder model to a specific library of your choice within Salesforce Commerce Cloud.
Overview of @builder.io/figma
mainThe@builder.io/figmapackage is designed to facilitate the synchronization between Figma designs and Builder.io. While full documentation is pending, users looking for immediate functionality can use the HTML to Figma plugin to bridge the gap between web content and Figma designs.Overview of the Builder.io platform
mainBuilder.io is a visual development platform that connects to your existing website or application. It allows you to visually edit content and generate code using your own existing components. Developers can use Figma designs or a drag-and-drop editor to create experiences and then publish updates via Builder.io SDKs.Use the Builder.io Algolia plugin
mainThe Builder.io Algolia plugin allows you to sync your Builder content to Algolia. This enables high-performance search capabilities for your product data, landing pages, or custom data models within your application.Understand Content State management in Builder.io SDKs
mainIn Builder.io SDKs, the content state is determined by a combination of props provided by the user. These props are used to generate the initial value of the context within the
Contentcomponent. The three primary props that dictate content state are:content: The JSON representation of the content.data: The data object used for data bindings within the content.locale: Provides locale-specific overrides for the content.
Use Builder App Context for plugin development
mainThe@builder.io/app-contextpackage provides application context typings specifically designed for developers building Builder plugins. Use these typings to ensure type safety when interacting with the Builder application context within your plugin implementation.Use Action Shortcuts in Builder
mainAction shortcuts allow content creators to perform complex tasks without writing code. They simplify workflows by enabling non-developers to:
- Trigger tracking events (e.g., sending events to Google Analytics on
submitorclick). - Set up conditional values.
- Set specific values on state.
This plugin example demonstrates how to define an
action shortcutthat triggers Google Analytics events on specified element events.- Trigger tracking events (e.g., sending events to Google Analytics on
Understand the Builder.io Personalization Container
mainThe Personalization Container is a core component in Builder's SDK that enables targeting and scheduling capabilities at the block level. It renders different content variants based on user attributes (stored in cookies) and targeting criteria.
Key behaviors:
- SSR (Server-Side Rendering): Renders all variants but initially displays only the default variant to support SEO and prevent layout shifts.
- Targeting: Evaluates rules against user attributes to determine the winning variant.
- DOM Updates: Updates the DOM to show the winning variant as quickly as possible.
- Events: Dispatches events when variants are loaded or displayed.
Understand SSR A/B testing behavior
mainBuilder.io uses a hybrid Server-Side Rendering (SSR) and Client-Side Rendering (CSR) approach to handle A/B testing variants without causing layout shifts or hydration mismatches.
SSR Phase:
- The server renders every single variant in the HTML.
- The default variant is shown.
- All other variants are hidden using CSS (
display: none) and HTML attributes (hidden,aria-hidden).
CSR Phase (Pre-hydration):
- Inlined scripts (
updateCookieAndStylesandupdateVariantVisibility) execute immediately before the web framework hydrates. - These scripts read/set a cookie to determine the winning variant.
- The scripts modify the DOM to show the winning variant and hide/remove the losing ones.
- The scripts and associated style tags 'self-destruct' (remove themselves) once their task is complete to clean up the DOM.
Supported Builder.io SDKs
mainBuilder.io provides a suite of new-generation SDKs generated via Mitosis. The following frameworks are supported:
- React-Native
- Vue 3
- Svelte
- SolidJS
- Angular
- Qwik
- React
- NextJS (Experimental for React Server Components registration support)
Understand Gen2 SDK build outputs and environments
mainGen2 SDKs are generated using Mitosis and are built for three specific environments to handle environment-specific code (such as the
evaluatorfor arbitrary JS).Each SDK produces three bundles, typically located in the following directories within the SDK's output folder:
lib/browser: For browser environments.lib/node: For NodeJS environments.lib/edge: For edge runtimes.
Vue SDK Version and Feature Support
mainVersion Support
- Standalone Vue 3
- Nuxt 3
Fetch
This package uses the
fetchAPI for network requests.