Frequently Asked Questions

Migration from UIX to App Framework

What is the process for migrating from UI Extensions (UIX) to the Hygraph App Framework?

The migration from UI Extensions (UIX) to the Hygraph App Framework involves three main steps:

  1. Declare your app for migration: Register your app via the App registration page, providing details such as Name, Description, Avatar URL, API ID, and Setup URL. Configure Elements (Field or Sidebar) as needed.
  2. Create a Setup Page: Update your code to use the new SDKs (@hygraph/app-sdk-react or @hygraph/app-sdk), remove legacy declarations, and implement a setup form that calls updateInstallation with the required configuration.
  3. Update fields to use the new App Elements: After installation, navigate to the Schema Editor and update fields to use the new App Elements by selecting them from the dropdown menu.
For a detailed, step-by-step example, refer to the official migration guide.

How do I declare my app for migration in Hygraph?

To declare your app for migration, access the App registration page and fill in the required details: Name, Description, Avatar URL, API ID, and Setup URL. The Elements section lets you specify Field or Sidebar types, features, URLs, and configuration. For more details, see the migration guide.

What changes are needed in my code when migrating from UIX to the App Framework?

You need to replace @graphcms/uix-react-sdk with @hygraph/app-sdk-react (or @graphcms/uix-sdk with @hygraph/app-sdk for vanilla JS), update imports, and remove the declaration from the Wrapper. You should also implement a setup form that uses the useApp hook and calls updateInstallation with the necessary configuration. For code examples, see the migration documentation.

How do I update fields to use the new App Elements after migration?

After installing your app and completing the setup, navigate to the Schema Editor in Hygraph. Update the fields that previously used UIX by selecting the new App Element from the dropdown menu. This allows you to leverage the new app-based functionality in place of the legacy UIX. See the official guide for screenshots and details.

Is there a step-by-step example for migrating a Field UIX or Sidebar UIX to the App Framework?

Yes, the migration guide provides detailed, step-by-step examples for both Field UIX and Sidebar UIX. These examples include code snippets and instructions for updating your implementation to use the App Framework.

What resources are available to help with the migration from UIX to the App Framework?

Hygraph provides comprehensive documentation and resources to support your migration, including:

Technical Support & Implementation

What support is available if I encounter issues during migration?

Hygraph offers 24/7 support via chat, email, and phone. You can also access real-time troubleshooting through the Intercom chat, join the Hygraph Community Slack channel, and consult extensive documentation at Hygraph Documentation. Enterprise customers receive a dedicated Customer Success Manager (CSM) for personalized guidance. Training resources such as webinars, live streams, and how-to videos are also available.

How long does it typically take to implement changes when migrating to the App Framework?

The implementation timeline depends on your project scope and requirements. For example, Top Villas launched a new project within 2 months from the initial touchpoint, and Si Vale met aggressive deadlines during their initial implementation. Hygraph's structured onboarding process and training resources help accelerate adoption and minimize downtime. See case studies for more details.

Features & Capabilities

What are the benefits of migrating to the Hygraph App Framework?

Migrating to the Hygraph App Framework allows you to:

For more on the App Framework's capabilities, see the App Framework documentation.

Can I add multiple UIX/App Elements under the same app during migration?

Yes, you can add multiple UIX/App Elements under the same app. Once the app is installed, users will be able to use all of the elements included in the app. The Elements section of the registration form allows you to configure this. See documentation for details.

General Hygraph Platform Support

What training and onboarding resources does Hygraph provide for developers migrating to the App Framework?

Hygraph offers a structured onboarding process, including introduction calls, account provisioning, business and technical kickoffs, and content schema planning. Training resources such as webinars, live streams, and how-to videos are available, along with extensive documentation at Hygraph Documentation. Enterprise customers receive a dedicated Customer Success Manager (CSM) for personalized support.

Where can I find more technical documentation and examples for the App Framework?

You can find comprehensive technical documentation, guides, and examples for the App Framework at Hygraph App Framework Documentation. This includes tutorials, API references, quick starters, and detailed migration guides.

Help teams manage content creation and approval in a clear and structured way
Hygraph
Docs

#App Framework migration guide

#Overview

This document covers the migration process from UIX to app. In order to follow this guide, you need to have access to our App Framework.

At the end of the document, we also offer an example you can follow.

#1. Declare your app for migration

Follow these steps to declare your app for migration:

  1. Access our App registration page, and fill in the form details:
  2. Write a Name and, optionally, a Description for your app. Then, add an Avatar URL. This is is the logo that will display next to your app's name. Name, Description, and Avatar URL are later on shown to users in the installation URL.
  3. API ID decides the final installation URL for your app. For instance, the installation URL could be something like https://app.hygraph.com/apps/my-app/new.
  4. Setup URL is where the app is configured or installed. For an app you'll need a setup page where updateInstallation SDK method has to be called, and a page where the Element (UIX) is deployed. This document section provides additional information on how to create your Setup Page but, essentially, in your Setup URL, you can show users a custom installation form for them to enter the API_KEY and then call updateInstallation(accessed via useApp hook).
  5. For the purpose of this document, consider Elements to be a synonymous of UIX. This document contains detailed information on how to use the Elements form. For migrations, please consider the following:
    • Description & Name: This information is rendered in the Field card in the Schema Editor.
    • Type: If you're migrating from a Field UIX, select Field as Element type. If you're migrating from a Sidebar UIX, then use formSidebar instead.
    • Features: Element features indicate where the App Element should be used instead of native Hygraph Renderers.
    • URL: Element URL is what we render in the iframe.
    • Config: This is the same as declaration fieldConfig, and it's used to set up instance config.

Declare your app for migrationDeclare your app for migration

#2. Create a Setup Page

The next step is to make a Setup Page and update your UIX code:

  1. Replace @graphcms/uix-react-sdk with package @hygraph/app-sdk-react (if you're using vanilla JS SDK @graphcms/uix-sdk then replace it with @hygraph/app-sdk), and update the import accordingly.
  2. Remove declaration from Wrapper.

#Field UIX

If you used a Field UIX code, like the one shown in our examples section, the final code for your app should look similar to this:

// Setup page
import { useApp, Wrapper } from '@hygraph/app-sdk-react';
const SetupForm = () => {
const { installation, updateInstallation } = useApp();
return (
<form
onSubmit={(e) => {
e.preventDefault();
updateInstallation({
config: {
API_KEY: e.currentTarget.elements.API_KEY.value,
},
status: 'COMPLETED',
});
}}
>
<input type="text" name="API_KEY" />
<input type="submit" value={'Install App'} />
</form>
);
};
const SetupPage = () => {
return (
<Wrapper>
<SetupForm />
</Wrapper>
);
};
// Field
import { Wrapper, useFieldExtension } from '@hygraph/app-sdk-react';
function MyField() {
const { value, onChange, installation } = useFieldExtension();
console.log(installation.config);
return <input value={value} onChange={(e) => onChange(e.target.value)} />;
}
export default function MyCustomInputExtensionPage() {
return (
// no declaration
<Wrapper>
<MyField />
</Wrapper>
);
}

If you used a Sidebar UIX code, like the one shown in our examples section, the final code for your app should look similar to this:

// Setup page
import { useApp, Wrapper } from '@hygraph/app-sdk-react';
const SetupForm = () => {
const { installation, updateInstallation } = useApp();
return (
<form
onSubmit={(e) => {
e.preventDefault();
updateInstallation({
config: {
API_KEY: e.currentTarget.elements.API_KEY.value,
},
status: 'COMPLETED',
});
}}
>
<input type="text" name="API_KEY" />
<input type="submit" value={'Install App'} />
</form>
);
};
const SetupPage = () => {
return (
<Wrapper>
<SetupForm />
</Wrapper>
);
};
// Sidebar
import { useFormSidebarExtension, Wrapper } from '@hygraph/app-sdk-react';
function SidebarElement() {
const { extension } = useFormSidebarExtension();
return (
<div>
<h3>Sidebar Example</h3>
<button onClick={() => alert('Hello, Hygraph!')}>Click Me</button>
</div>
);
}
export default function Sidebar() {
return (
<Wrapper>
<SidebarElement />
</Wrapper>
);
}

#3. Update fields to use the new App Elements

Once a user has installed the app - updateInstallation is called with status COMPLETED - they can Navigate to the Schema editor, and update their fields, previously used by UIX, to use the new App Element by selecting it from the dropdown as shown in the example below:

Update fields to use the new App ElementsUpdate fields to use the new App Elements

#Step by step example

Imagine you have the following Field UIX:

import { Wrapper, useFieldExtension } from '@graphcms/uix-react-sdk';
function MyField() {
const { value, onChange } = useFieldExtension();
return <input value={value} onChange={(e) => onChange(e.target.value)} />;
}
const declaration = {
extensionType: 'field',
fieldType: 'STRING',
name: 'My custom field',
features: ['FieldRenderer', 'ListRenderer'],
config: {
API_KEY: {
type: 'string',
displayName: 'API Key',
},
},
};
export default function MyCustomInputExtensionPage() {
return (
<Wrapper declaration={declaration}>
<MyField />
</Wrapper>
);
}

Or the following Sidebar UIX:

import { Wrapper, useFormSidebarExtension } from '@graphcms/uix-react-sdk';
const SidebarElement = () => {
const { extension } = useFormSidebarExtension();
return (
<div>
<h3>Sidebar Example</h3>
<div>
<button onClick={() => alert('Hello, Hygraph!')}>Click Me!</button>
</div>
</div>
);
};
const declaration = {
extensionType: 'formSidebar',
name: 'Sidebar name',
description: 'Sidebar description',
};
const SidebarExample = () => {
return (
<Wrapper declaration={declaration}>
<SidebarElement />
</Wrapper>
);
};
export default SidebarExample;

With UIX you can deploy it on any platform - e.g. Vercel, Netlify, Render, etc. - and share the URL with people who'd like to use the extension.

In this case, people could then go to project > project settings > UI Extensions and add your UIX to their project, which can then be used in place of native Hygraph native renderer.

For an app the process is different. As we mentioned before, you'll need a setup page where updateInstallation SDK method has to be called, and a page where the Element (UIX) is deployed.

To migrate this example from UIX to app follow these steps:

  1. Declare your app for migration as explained in detail here.
  2. If users tried to install the UIX shown in the example above, they'd be able to add API_KEY from Hygraph's UI, but for apps this is done by the app developer. In this step, you will create a setup page, as shown here. In your setup page, you can render a form for users to enter API_KEY and then call updateInstallation({status: "COMPLETED", config:{ API_KEY: "API Key input value" }}) (accessed via useApp hook). config provided to updateInstallation hook is just like global config for UIX and can be accessed in Field App Element.
  3. Once updateInstallation is called with status COMPLETED, you can navigate to the Schema editor and update your fields to use the new App Elements, as shown here.

#Resources

  • App Framework: Overview to our App Framework, which extends Hygraph capabilities, offering the possibility of creating your own custom apps and sharing them with other users.
  • Register an app: Documentation for developers on how to register an app on the Hygraph platform.
  • Using app tokens: Document on how to generate an app token for your app during installation.
  • Install an app: Step by step guide on how to install an app in your Hygraph project.
  • Delete an app: Documentation for developers on how to delete an app you have created.
  • First steps: Comprehensive step-by-step guide on how to develop an app with custom field and sidebar elements.
  • Next.js starter: Document that guides you through the process of developing an app with a custom field using our Next.js starter.
  • API Reference: Our App Framework API Reference.