Use case: Vercel deployment
Example use case of using Vercel webhooks with Optimizely Graph.
A deploy hook in Vercel lets you programmatically trigger deployments of your projects. Registering this deploy hook with the Optimizely Graph webhook API allows you to automate deployments when specific events occur, such as content updates or changes to your data source.
Create a deploy hook
To create a deploy hook in Vercel, complete the following:
-
Log in to your Vercel account. You can sign up for free if you do not have an account.
-
Create a new project or select an existing one in the Vercel dashboard where you want to set up the deploy hook.
-
Generate a deploy hook URL.
- Go to the project settings by clicking the project name in the Vercel dashboard.
- In Deploy Hooks, click Add or Create Deploy Hook to generate a new deploy hook.
-
Configure the deploy hook.
-
Provide a name for the deploy hook to identify its purpose (such as Optimizely Graph Deploy).
-
Set the target branch or branches where the deploy hook should be triggered. You can specify a branch or use a wildcard character to match multiple branches.

-
-
Save the deploy hook configuration.
-
Copy the generated deploy hook URL. This URL registers the webhook with the Optimizely Graph webhook API.
Register the deploy hook with the Optimizely Graph webhook API
Registering the deploy hook with Optimizely Graph enables seamless automation in your development workflow. To register the deploy hook with the Optimizely Graph webhook API and trigger deployments based on specific events:
- Use a tool or library of your choice (such as cURL, Postman, or an HTTP client library) to make a POST request to
https://cg.optimizely.com/api/webhooks. - Use either Basic or HMAC authentication in the request.
- In the request payload, include the required parameters, including the URL endpoint obtained from Vercel and any other configuration needed for your deployment.
- Send the request and await the response from the Optimizely Graph webhook API.
- After registration, the API responds with details of the registered webhook, including its unique identifier.
Ensure you handle errors or exceptions during the registration process and validate the response to confirm a successful integration.
Test the integration
To test the integration between Vercel deploy hooks and the Optimizely Graph webhook API using the Optimizely CMS Dashboard:
-
Go to the Optimizely CMS Dashboard for your project. By modifying a content item, you can simulate a scenario and confirm that the webhook integration functions correctly, ensuring deployments are triggered automatically when content changes.
-
Make changes to a content item that should trigger a deployment. For example, update the content, modify metadata, or change the structure of a content type.
-
Save the changes in the Optimizely CMS Dashboard. This action triggers a webhook event and notifies Vercel to begin the deployment.
-
Monitor the Vercel deployment logs or any relevant output to confirm that Vercel received and processed the webhook event.
-
Verify that the deployment occurs as expected on Vercel.

Handle any errors or exceptions during webhook event processing and deployment. Review the documentation for Vercel deploy hooks, the Optimizely Graph webhook API, and Optimizely CMS for monitoring and troubleshooting guidance.
Updated 16 days ago
