Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog InCross-platform products
Dev guide
All
Pages
Start typing to search…

Use case: Vercel deployment

Example use case of using Vercel webhooks with Optimizely Graph.

Adeploy hook in Vercel lets you programmatically trigger deployments of your projects. Registering this deploy hook with the Optimizely Graph webhook API lets you automate deployments whenever 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:

  1. Log in to yourVercel account. You can sign up for free if you do not have an account.

  2. Create a new project or select an existing project on the Vercel dashboard where you want to set up the deploy hook.

  3. Generate a deploy hook URL.

    1. Go to the project settings by clicking on the project name in the Vercel dashboard.
    2. InDeploy Hooks, clickAdd orCreate Deploy Hook to generate a new deploy hook.
  4. Configure the deploy hook.

    1. Provide a name for the deploy hook to identify its purpose (such asOptimizely Graph Deploy).

    2. 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.

  5. Save the deploy hook configuration.

  6. Copy the generated deploy hook URL. This URL registers the webhook with the Optimizely Graph webhook API.

Register deploy hook with Optimizely Graph webhook API

Regeristing the deploy hook with Optimizely Graph lets you create seamless automation in your development workflow. To register the deploy hook with the Optimizely Graph webhook API using the provided endpoint to trigger deployments based on specific events from Optimizely Graph:

  1. Use a tool or library of your choice (such ascURL,Postman, or an HTTP client library) to make a POST request tohttps://cg.optimizely.com/api/webhooks.
  2. Use eitherBasic orHMAC authentication within the request.
  3. In the request payload, include the necessary parameters, including theURL endpoint obtained from Vercel for the deploy hook in the previous section and any other configurations specific to your deployment needs.
  4. Send the request and await a response from the Optimizely Graph webhook API.
  5. After registration, the API responds with the details of the registered webhook, including its unique identifier.

Ensure you handle any potential errors or exceptions during the registration process and validate the response from the Optimizely Graph webhook API to ensure 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:

  1. Go to the Optimizely CMS Dashboard for your project. Using the Optimizely CMS Dashboard to modify a content item, you can simulate a scenario and validate that the webhook integration between Vercel and the Optimizely Graph webhook API functions correctly. This ensures that deployments are triggered automatically when content changes, streamlining your development workflow.

  2. Make changes to a content item that should trigger a deployment. For example, you can update the content, change metadata, or modify the structure of a content type.

  3. Save the changes in the Optimizely CMS Dashboard. This action triggers a webhook event and notifies Vercel to start the deployment process.

  4. Monitor the Vercel deployment logs or any relevant output to ensure Vercel received and processed the webhook event.

  5. Verify that the deployment of your project occurs as expected on Vercel.

Handle potential errors or exceptions during the webhook event processing and deployment process. Also, you should review theVercel deploy hooks documentation, theOptimizely Graph webhook API, andOptimizely CMS for information on monitoring and troubleshooting.

Updated 2 months ago



[8]ページ先頭

©2009-2025 Movatter.jp