{"id":20039197,"url":"https://github.com/defra/gwa-notification-receipt","last_synced_at":"2026-07-16T09:33:44.503Z","repository":{"id":40275719,"uuid":"355935315","full_name":"DEFRA/gwa-notification-receipt","owner":"DEFRA","description":"Azure Function app for receiving callbacks from GOV.UK Notify.","archived":false,"fork":false,"pushed_at":"2023-07-19T02:05:32.000Z","size":1349,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T04:46:38.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.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":"2021-04-08T14:15:59.000Z","updated_at":"2024-04-23T05:51:59.000Z","dependencies_parsed_at":"2024-11-13T10:48:17.522Z","dependency_job_id":null,"html_url":"https://github.com/DEFRA/gwa-notification-receipt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DEFRA/gwa-notification-receipt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fgwa-notification-receipt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fgwa-notification-receipt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fgwa-notification-receipt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fgwa-notification-receipt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/gwa-notification-receipt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fgwa-notification-receipt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35539516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-16T02:00:06.687Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T10:36:20.063Z","updated_at":"2026-07-16T09:33:44.480Z","avatar_url":"https://github.com/DEFRA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GWA Notification Receipt\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)\\\n[![Build and Deploy Production](https://github.com/DEFRA/gwa-notification-receipt/actions/workflows/build-and-deploy-production.yml/badge.svg)](https://github.com/DEFRA/gwa-notification-receipt/actions/workflows/build-and-deploy-production.yml)\n[![Build and Deploy Staging](https://github.com/DEFRA/gwa-notification-receipt/actions/workflows/build-and-deploy-staging.yml/badge.svg)](https://github.com/DEFRA/gwa-notification-receipt/actions/workflows/build-and-deploy-staging.yml)\\\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_gwa-notification-receipt\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_gwa-notification-receipt)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_gwa-notification-receipt\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=DEFRA_gwa-notification-receipt)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_gwa-notification-receipt\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DEFRA_gwa-notification-receipt)\\\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_gwa-notification-receipt\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=DEFRA_gwa-notification-receipt)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_gwa-notification-receipt\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=DEFRA_gwa-notification-receipt)\n[![Known Vulnerabilities](https://snyk.io/test/github/defra/gwa-notification-receipt/badge.svg)](https://snyk.io/test/github/defra/gwa-notification-receipt)\n\n\u003e An [Azure Function app](https://azure.microsoft.com/en-gb/services/functions/)\n\u003e for receiving callbacks from\n\u003e [GOV.UK Notify](https://www.notifications.service.gov.uk/)\n\nThe app exposes an HTTP endpoint where Notify can POST a callback to. The\nmessage is checked for correct authorization, added to a queue for processing\nbefore updating an item in a Cosmos DB container.\n\n## Functions\n\nThe app is made up of a number of functions, each function is explained in more\ndetail in its' own README:\n\n* [ReceiveReceipt](ReceiveReceipt/README.md)\n* [ProcessReceipt](ProcessReceipt/README.md)\n\n## Development\n\nThe best place to start for an overall view of how JavaScript Functions work in\nAzure is the\n[Azure Functions JavaScript developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2).\nFrom there follow the appropriate link to the documentation specific to\nyour preferred development environment i.e.\n[Visual Studio Code](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-node)\nor\n[command line](https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-node?tabs=azure-cli%2Cbrowser).\n\nThe documentation within this repo assumes the `command line` setup has been\ncompleted, specifically for\n[Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).\n\n## Running Locally\n\nTo start the function app run `func start` or `npm run start` (which just runs\n`func start`).\n\n### Pre-requisites\n\nThe app uses Azure Storage queues. When working locally\n[Azurite](https://github.com/Azure/Azurite) can be used to emulate storage.\nFollow the\n[instructions](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite)\nfor your preferred installation option.\n\nThe app uses Cosmos DB. Whilst an emulator can be\n[installed locally](https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator?tabs=cli%2Cssl-netstd21)\nthe effort involved is significant in comparison to using the real thing. On\nthis basis it is advisable to use a real Cosmos DB instance.\n\nThe app uses `local.settings.json` for local development.\n[.local.settings.json](.local.settings.json) can be used as the\nbasis as it contains all required env vars with the exception of secrets which\nhave been removed. The connection string for Azurite is included.\n\n## Notify Set Up\n\nThe app receives message receipts from Notify. Getting set up on Notify is\nstraight forward, simply follow the\n[documentation](https://www.notifications.service.gov.uk/using-notify/get-started).\n\nA callback needs to be set up for the service created in Notify, additional\ninformation in the\n[documentation](https://docs.notifications.service.gov.uk/rest-api.html#callbacks).\nThe callback requires a bearer token be set along with the callback URL.\n\n### Callback URL\n\nIn order to test the function it would ideally be deployed so that Notify can\naccess the URL. There are options available to expose localhost to the internet\nsuch as [ngrok](https://ngrok.com/) and\n[localtunnel](https://localtunnel.github.io/www/), however, deploying the\nfunction is simple, more robust and safer.\n\nHTTP Azure Functions can be set to require a\n[key for access](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp#authorization-keys).\nThe callback URL set in Notify needs to include the key for the function.\n\n### Bearer token\n\nNotify requires a bearer token to be set. It is used in the\n[Authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization).\nThe function checks the header is the expected value as set in the env var\n`NOTIFY_BEARER_HEADER`. Note that the check is against the full header value,\nno manipulation of it takes place for simplicity.\n\n## License\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT\nLICENCE found at:\n\n\u003chttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\u003e\n\nThe following attribution statement MUST be cited in your products and\napplications when using this information.\n\n\u003e Contains public sector information licensed under the Open Government license\n\u003e v3\n\n### About the license\n\nThe Open Government Licence (OGL) was developed by the Controller of Her\nMajesty's Stationery Office (HMSO) to enable information providers in the\npublic sector to license the use and re-use of their information under a common\nopen licence.\n\nIt is designed to encourage use and re-use of information freely and flexibly,\nwith only a few conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fgwa-notification-receipt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fgwa-notification-receipt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fgwa-notification-receipt/lists"}