We're transitioning Studio from Beta to Early Availability
Hygraph
Docs

You are currently reading the Studio Docs. If you were looking for the Classic Docs check here

Connect your Hygraph project to Imgix

Imgix lets you create, transform, and optimize images and videos.

#What you can do with the Hygraph-Imgix integration

With the Imgix app, you can serve assets from your Hygraph project and from other Imgix sources to add to your content.

#Prerequisites to use this integration

  • You must have a Hygraph account. If you don't have one, you can create one here.
  • You must have a Hygraph project with at least one model.
  • You must have a Imgix account. If you don't have one yet, you can create one here.

#Configure a source

The first thing we need to do is configure a source in your Imgix account. The configuration flow will vary depending on whether you want to serve assets from your Hygraph project or from one of the other configurable sources.

#Using assets from Hygraph

  1. Create a new Imgix source, selecting Web Folder as a Storage Type. This document contains more details about the Web Folder source.

  2. Enter the base URL for your Imgix source. If your Hygraph project is using the Legacy asset system, you will need to use https://media.graphassets.com/ as the base URL. If your project uses the Hygraph Asset Management system, follow the instructions below to obtain the URL, go to the Assets tab in the Hygraph app and right click any asset thumbnail, then select Copy Image Address at the bottom of the preview. Keep the part before /output=... and delete the rest.

    Base URL example: If your copied URL is

    https://eu-central-1-shared-euc1-02.graphassets.com/clv45iyzm039407umd5w7aemt/output=format:jpg/resize=width:59,height:59,fit:crop/clw6dt8hndhuu07w6tcaqt9h3

    You should use the following as the base URL:

    https://eu-central-1-shared-euc1-02.graphassets.com/clv45iyzm039407umd5w7aemt
  3. Use the default Imgix subdomain or configure your own, and press the Deploy Source button.

#Using assets from other sources

This flow is different depending on the selected source. Check out Imgix's documentation for instructions on configuring your Imgix source.

#Install the Imgix app

Click here to install the Imgix App on Hygraph, then follow these steps:

The installation flow will vary depending on whether you want to serve assets from your Hygraph project or from one of the other configurable sources.

#Install using a Hygraph source

  1. Use the dropdowns to select which project and environment you want to install the app in, then click Install app.
  2. The permissions pop-up will display. Clicking Authorize app finishes the installation and takes you to the app configuration screen.
  3. Next, you need to configure the app. To do that, you first need to select Webfolder as a source type in the Hygraph app configuration - this should be the default value.
  4. Enter your imgix source domain in the Source URL field, prefixed with https://.
  5. Click Save config settings to finish the configuration process. A pop-up notification in the bottom right corner of the screen will indicate that the changes have been saved.

#Install using other sources

  1. Use the dropdowns to select which project and environment you want to install the app in, then click Install app.

  2. The permissions pop-up will display. Clicking Authorize app finishes the installation and takes you to the app configuration screen.

  3. Next, you need to configure the app. To do that, you first need to select Other as a source type in the Hygraph app configuration.

  4. Enter your imgix source domain in the Source URL field, prefixed with https://.

  5. Fill in the API Key field with an API key obtained from your Imgix account.

  6. Fill in the Source ID field with the ID if your Imgix source. To find your source ID, go to your Imgix dashboard, navigate to Sources, and select View on the source you want. You will find the source ID under the Source ID field.

  7. Click Save config settings to finish the configuration process. A pop-up notification in the bottom right corner of the screen will indicate that the changes have been saved.

#Add the Imgix field to your model

  1. Navigate to the Schema builder.
  2. Select the model that you want to add the Imgix field to.
  3. Select the Imgix field from the Add fields right sidebar.
  4. Complete the Display name field, and the API ID will be auto-filled by the system. Optionally, you can also add a Description.
  5. This screen also allows you to control different properties of your Akeneo field: you can allow multiple values, or you can localize the field, by selecting the checkboxes in the Field options section.
  6. Click Add.

#Use Imgix in your Hygraph project

  1. Navigate to the Content editor.
  2. Select the view that you configured the Imgix for.
  3. Click + Add entry to create a new entry or, alternatively, edit an existing entry by clicking on the pencil icon.
  4. Locate the Imgix section of the screen and click on Add assets. This opens a new screen where you can select and add assets to your Hygraph content entry.
  5. Select the asset(s) you want, and then click Add selected assets. If your Imgix Field configuration allows multiple values, you will be able to select multiple assets.
  6. After selecting the asset(s) you want and returning to the content entry, your selection will display on the list. You can optionally use the six dots icon to drag and drop the assets on the list to organize them in the order you want, or click on the X on the right of an asset card to remove it form the list.
  7. Finally, click Save or Save & Publish, as needed.

#Troubleshooting

  • If you replace an asset file in Hygraph, it will not update and show the old version instead. Please delete the asset completely and create a new one if you want to change the displayed image.

  • Sometimes, fields might get clipped and the button to add or change assets might not be visible. Refreshing the page resolves the issue. This a rare but known bug for Hygraph apps. If the issue still persists after a refresh open an issue.

#Resources