How to access Vercel preview comments via API or webhooks for automation

We would like to be able to automate getting comments that are added to previews via webhooks or polling them on an API.

Use Case

We would map the location to the source code of the content (best effort) and assign them as a comment to our internal (e.g. GitHub Copilot on the PR) AI. The mapping from location in the preview to the source code location in our MDX is custom logic so I doubt it can be an OOTB Vercel feature.

Requirements

Comments would e.g. have to have:

  • DOM path
  • URL location
  • Content extract

This would enable very nice feedback loops and interaction models.