Connect your Hygraph project to Vercel
The Hygraph Integration allows you to seamlessly update your static deployments at the push of a button from within Hygraph itself. Not to be confused with triggered builds via webhooks, this integration allows you to install a button in the Hygraph sidebar of a content model for manual redeploys.
What you can do with the Hygraph-Vercel integrationAnchor
- Trigger Vercel builds from within your content view with a single click.
- Specify which content models display the button in the sidebar, giving you more control over how builds are triggered when there are changes to your content.
Prerequisites to use this integrationAnchor
- When using this integration, you should already have a static site deployed in an active Vercel project. Don’t have one? Set up a free Vercel account or learn about other plans!
- You should have an existing Hygraph project. Sign up for a free Hygraph developer account.
- Your Vercel site should be configured to support continuous deployment.
How to install the Vercel appAnchor
Click on the Install Vercel for Hygraph button to start the installation flow.
In the dropdown, select which project you want to install the app in, then click on the Add App button. You should be redirected to your Hygraph project dashboard.
Click on the Connect to Vercel button to connect Hygraph to the project hosted on Vercel. You should be redirected to the Vercel website, where you can see information about the app and authorize the installation. Click on the Add Integration button to authorize the app.
In the dropdown, select the Vercel Account to add the integration to, then click on the Continue button. You will be redirected back to the Hygraph dashboard.
Now, select the Vercel project in the dropdown, enter the GitHub repository Branch name and the Display Name. Finally, click on the Save button.
Now that the app is installed, the next step is to add the Vercel build button to the sidebar of to one or more of your project's models, so that you can trigger builds from the content editor.
How to add the build button to the sidebarAnchor
On the left side navigation, go to the Schema editor.
Under the Models section, click on the model you want to add the Vercel build button to.
Click on the Sidebar tab.
Under Sidebar Widgets, click on the Deploy to Vercel widget to add it to the sidebar.
Obs.: If you can't see the widget in the sidebar, you should do a hard refresh of the page by hitting
Ctrl + R (Windows/Linux) or
Cmd + R (macOS). Then, you should see it.
In the Add Widget pop-up, Display Name and Description fields will be pre-filled. You can edit them if you want. Otherwise, just click on the Create button to add it to the model sidebar.
Finally, you can drag and drop the widget by clicking on the six dots icon to reorder the sidebar widgets if you want.
Now, let's learn how to trigger builds from the content editor.
How to trigger a buildAnchor
- Click on the Go to content editing link at the top right of the Schema editor. Alternatively, you can also click on the Content icon, in the left side navigation.
- Click on the model you added the sidebar widget to.
- Click on the Edit button of an existing entry. Or click on the Create Entry button.
- Finally, click on the Start Building button, located in the sidebar. Once you do that, the button state changes and the build will start on Vercel. Under the button, you should see the last date a build has been triggered.