{"id":15173197,"url":"https://github.com/hookdeck/supahooks","last_synced_at":"2025-07-24T23:12:29.439Z","repository":{"id":252453665,"uuid":"840491492","full_name":"hookdeck/supahooks","owner":"hookdeck","description":"An example of using Hookdeck as outbound webhook infrastructure within a Next.js application","archived":false,"fork":false,"pushed_at":"2025-01-30T11:56:46.000Z","size":4508,"stargazers_count":11,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T15:23:57.943Z","etag":null,"topics":["asynchronous-programming","event-driven-application","event-driven-architecture","nextjs","nextjs-starter","nextjs-template","supabase","supabase-db","webhooks"],"latest_commit_sha":null,"homepage":"https://hookdeck.com/blog/outbound-webhooks-nextjs-template?ref=github-outbound-webhooks-template","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","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-08-09T20:42:26.000Z","updated_at":"2025-01-27T21:17:38.000Z","dependencies_parsed_at":"2024-12-16T12:26:30.053Z","dependency_job_id":"399f0f71-0987-4bad-bb95-f6caaec78e47","html_url":"https://github.com/hookdeck/supahooks","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"472943bb4707e3455f942d328bd22db5d02fae7d"},"previous_names":["leggetter/outbound-webhooks-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fsupahooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fsupahooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fsupahooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hookdeck%2Fsupahooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hookdeck","download_url":"https://codeload.github.com/hookdeck/supahooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238264673,"owners_count":19443388,"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":["asynchronous-programming","event-driven-application","event-driven-architecture","nextjs","nextjs-starter","nextjs-template","supabase","supabase-db","webhooks"],"created_at":"2024-09-27T10:42:20.132Z","updated_at":"2025-02-11T09:31:44.328Z","avatar_url":"https://github.com/hookdeck.png","language":"TypeScript","readme":"# SupaHooks: Outbound Webhooks Template for Hookdeck\u003c/h1\u003e\n\nA template demonstrating using [Hookdeck](https://hookdeck.com?ref=github-outbound-webhooks-template) as your outbound webhook infrastructure.\n\n![Outbound Webhooks with Hookdeck](docs/outbound-webhooks-demo-v3.png)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://www.youtube.com/watch?v=v2CX6EseFS0\"\u003e📽️ Watch the SupaHooks video walkthrough\u003c/a\u003e\u003c/p\u003e\n\n## About\n\n[Hookdeck](https://hookdeck.com?ref=github-outbound-webhooks-template) is an [event gateway](https://hookdeck.com/blog/event-gateway-definition?ref=github-outbound-webhooks-template): infrastructure that supports use cases, including receiving webhooks, sending webhooks, and connecting third-party services.\n\nThis template provides the basic building blocks for registering and managing webhook subscriptions with Hookdeck.\n\nSpecifically:\n\n- Each webhook subscription is represented within Hookdeck as a [Connection](https://hookdeck.com/docs/connections?ref=github-outbound-webhooks-template).\n- A Connection has a [Destination](https://hookdeck.com/docs/destinations?ref=github-outbound-webhooks-template), representing the webhook endpoint.\n- A Connection also has a [Source](https://hookdeck.com/docs/sources?ref=github-outbound-webhooks-template), which a webhook publisher should make an authenticated request to publish an event.\n\n## Getting Started\n\n### App Dependencies\n\nInstall the project dependencies:\n\n```bash\nnpm i\n```\n\n### Credentials\n\n[Signup for Hookdeck](https://dashboard.hookdeck.com?ref=github-outbound-webhooks-template), and from within a project, get your **API key** and **signing secret** from **Settings -\u003e Secrets**.\n\n[Signup for Supabase](https://supabase.com/dashboard/sign-up?ref=github-outbound-webhooks-template), create a new project, and get your Supabase URL and Anon Key.\n\nAdd the credentials for Hookdeck and Supabase to a `.env.local` file along with a `PUBLISH_KEY`, which should be a unique key that enables webhooks to be triggered:\n\n```.env.local\n# Get these values from Project Settings -\u003e Secrets in the Hookdeck Dashboard\nHOOKDECK_API_KEY=\u003cyour_hookdeck_project_api_key\u003e\nHOOKDECK_SIGNING_SECRET=\u003cyour_hookdeck_project_signing_secret\u003e\n\n# Generate a secure value for this key\n# It is used to authenticate Supabase Database Webhook events\nHOOKDECK_PRODUCT_UPDATE_WEBHOOK_KEY=\u003cadd_your_own_unique_key_here\u003e\n\n# Get these values from Project Settings -\u003e Configuration -\u003e API in the Supabase Dashboard\nNEXT_PUBLIC_SUPABASE_URL=\u003cyour_supabase_project_url\u003e\nNEXT_PUBLIC_SUPABASE_ANON_KEY=\u003cyour_supabase_anon_key\u003e\n\n# Generate a secure value for this key\n# It is used to authenticate the publishing of webhook events\nPUBLISH_KEY=\u003cadd_your_own_unique_key_here\u003e\n```\n\n### Database and Hookdeck\n\nRun the following to generate your database schema:\n\n```bash\nnpm run setup\n```\n\nIf you have not logged in with the Hookdeck CLI (a project dev dependency), you will do so when running the above command.\n\nCopy the contents of [supabase/schema.sql](supabase/schema.sql) into the Supabase SQL editor and run it to create your schema.\n\n**Note: you may need to enable Database Webhooks for your project**.\n\nThis includes creating a `products` table that can be used for testing using [Supabase Database Webhooks](https://supabase.com/docs/guides/database/webhooks?ref=github-outbound-webhooks-template) as triggers for the SupaHooks outbound webhook notifications.\n\n### Authentication\n\nThe project uses [Server-Side Auth for Next.js](https://supabase.com/docs/guides/auth/server-side/nextjs?ref=github-outbound-webhooks-template). So, go to the [Auth templates](https://supabase.com/dashboard/project/_/auth/templates?ref=github-outbound-webhooks-template) page in your dashboard. In the Confirm signup template, change `{{ .ConfirmationURL }}` to `{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}\u0026type=signup`.\n\n## Run SupaHooks\n\nRun the development server:\n\n```bash\nnpm run dev\n```\n\nIn another terminal window, create a local tunnel with the Hookdeck CLI:\n\n```bash\nnpm run hookdeck:local\n```\n\nTry out the app:\n\n- Open [http://localhost:3000](http://localhost:3000).\n- Sign up for an account.\n- Create a webhook. Hint: Create a new Hookdeck Connection to test receiving webhooks.\n- View the webhooks and send test payloads using the **Test** button.\n- Use the table editor in Supabase and add rows to the `product` table to trigger Database Webhooks.\n\n## Learn More\n\n- [Hookdeck Documentation](https://hookdeck.com/docs?ref=github-outbound-webhooks-template)\n- [Supabase Documentation](https://supabase.com/docs?ref=github-outbound-webhooks-template)\n- [Next.js](https://nextjs.org)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fsupahooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhookdeck%2Fsupahooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhookdeck%2Fsupahooks/lists"}