{"id":21455523,"url":"https://github.com/hookdeck/hookdeck-vercel-example","last_synced_at":"2025-03-17T03:24:38.806Z","repository":{"id":236314752,"uuid":"792363185","full_name":"hookdeck/hookdeck-vercel-example","owner":"hookdeck","description":"An example of using the Hookdeck Vercel Middleware","archived":false,"fork":false,"pushed_at":"2024-10-29T17:35:52.000Z","size":2089,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T13:13:48.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hookdeck-vercel-example.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hookdeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T14:12:53.000Z","updated_at":"2024-10-29T17:35:56.000Z","dependencies_parsed_at":"2025-01-23T13:12:42.477Z","dependency_job_id":"2d8d0f2b-ff27-4139-b666-2ff1ef8a7eea","html_url":"https://github.com/hookdeck/hookdeck-vercel-example","commit_stats":null,"previous_names":["hookdeck/hookdeck-vercel-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fhookdeck-vercel-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fhookdeck-vercel-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fhookdeck-vercel-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fhookdeck-vercel-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hookdeck","download_url":"https://codeload.github.com/hookdeck/hookdeck-vercel-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243966064,"owners_count":20375992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T05:12:31.428Z","updated_at":"2025-03-17T03:24:38.786Z","avatar_url":"https://github.com/hookdeck.png","language":"TypeScript","readme":"This application demonstrates using the [Hookdeck Vercel Middleware](https://github.com/hookdeck/hookdeck-vercel) within a [Next.js](https://nextjs.org/) project.\n\n## Getting Started\n\n- Create a [Vercel](https://vercel.com?ref=github-hookdeck-vercel) account and a project.\n- Install the [Vercel CLI](https://vercel.com/docs/cli?ref=github-hookdeck-vercel)\n- [Signup for a Hookdeck account](https://dashboard.hookdeck.com/signup?ref=github-hookdeck-vercel)\n\n### Get the code\n\n```bash\nnpx create-next-app -e https://github.com/hookdeck/hookdeck-vercel-example hookdeck-vercel-example\ncd hookdeck-vercel-example\nnpm i\n```\n\n## Create your Vercel project\n\nUse the Vercel CLI to set up a Vercel project.\n\n```bash\nvercel link\n```\n\n\u003e Add a `--yes` flag if you want to skip the interactive options.\n\u003e ```bash\n\u003e vercel link --yes\n\u003e ```\n\n## Set your Vercel project environment variables\n\nAdd `HOOKDECK_API_KEY` and `HOOKDECK_SIGNING_SECRET` (optional but recommended) as [environment variables](https://vercel.com/docs/projects/environment-variables?ref=github-hookdeck-vercel)\nfor your Vercel project.\n\nGet the Hookdeck API key and Signing Secret from your [project secrets](https://dashboard.hookdeck.com/settings/project/secrets?ref=github-hookdeck-vercel).\n\n```bash\nvercel env add HOOKDECK_API_KEY production\nvercel env add HOOKDECK_SIGNING_SECRET production\n```\n\nThe above commands will prompt you for the values.\n\n### Deploy your application\n\nDeploy to the production environment:\n\n```bash\nvercel --prod\n```\n\nWithin the output, you'll see your **Inspect** URL.\n\n### Make an Asynchronous HTTP request\n\nNavigate to the *Inspect** URL and get your production `{domain}.vercel.app` URL.\n\n\u003e All other deployment URLs will be protected by default. You can change this in settings if you prefer.\n\nUse that URL to make a request to your middleware endpoint:\n\n```bash\ncurl --location 'https://{domain}}.vercel.app/api/webhooks' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"test\": \"value\"\n}'\n```\n\nYou will see output similar to the following:\n\n```json\n{\n  \"status\": \"SUCCESS\",\n  \"message\": \"Request successfully handled. Request ID: req_nlwiPJSOTRFb6vHYlVez\",\n  \"request_id\": \"req_nlwiPJSOTRFb6vHYlVez\"\n}\n```\n\n### Checkout the logs\n\nThe Vercel logs to see the middleware logging:\n\n![Vercel Logs](docs/vercel-logs.png)\n\nThe Hookdeck request logs to see the inbound requests:\n\n![Hookdeck requests](docs/hookdeck-requests.png)\n\nThe Hookdeck event logs to see the generated events and event deliveries:\n\n![Hookdeck events](docs/hookdeck-events.png)\n\n## Learn More\n\n- [Hookdeck Vercel Middleware repo](https://github.com/hookdeck/hookdeck-vercel)\n- [Hookdeck documentation](https://hookdeck.com/docs?ref=github-hookdeck-vercel-example)\n- [Vercel Middleware documentation](https://vercel.com/docs/functions/edge-middleware?ref=github-hookdeck-vercel-example)\n- [Next.js documentation](https://nextjs.org/docs?ref=github-hookdeck-vercel-example)\n\n## Deploy on Vercel\n\nFork this repository and click the **Deploy** button.\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhookdeck%2Fhookdeck-vercel-example\u0026env=HOOKDECK_API_KEY,HOOKDECK_SIGNING_SECRET)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fhookdeck-vercel-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhookdeck%2Fhookdeck-vercel-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fhookdeck-vercel-example/lists"}