{"id":21107343,"url":"https://github.com/ninjascl/airnotifier-moodle-bridge","last_synced_at":"2025-10-10T18:39:25.267Z","repository":{"id":38446399,"uuid":"257796259","full_name":"NinjasCL/airnotifier-moodle-bridge","owner":"NinjasCL","description":"A replacement API for AirNotifier Moodle Plugin that connects directly to Firebase and other Push Notification Providers","archived":false,"fork":false,"pushed_at":"2024-10-10T12:32:55.000Z","size":137,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-15T02:19:03.684Z","etag":null,"topics":["airnotifier","api","fastify","firebase","javascript","moodle","nodejs","plugin","pusher"],"latest_commit_sha":null,"homepage":"https://ninjas.cl","language":"JavaScript","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/NinjasCL.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2020-04-22T05:01:11.000Z","updated_at":"2024-12-03T17:11:49.000Z","dependencies_parsed_at":"2023-02-01T01:16:45.529Z","dependency_job_id":"56d15fbe-79c3-4979-b268-5034096bcbea","html_url":"https://github.com/NinjasCL/airnotifier-moodle-bridge","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NinjasCL/airnotifier-moodle-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NinjasCL%2Fairnotifier-moodle-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NinjasCL%2Fairnotifier-moodle-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NinjasCL%2Fairnotifier-moodle-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NinjasCL%2Fairnotifier-moodle-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NinjasCL","download_url":"https://codeload.github.com/NinjasCL/airnotifier-moodle-bridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NinjasCL%2Fairnotifier-moodle-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004914,"owners_count":26083803,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["airnotifier","api","fastify","firebase","javascript","moodle","nodejs","plugin","pusher"],"created_at":"2024-11-20T00:38:40.544Z","updated_at":"2025-10-10T18:39:25.252Z","avatar_url":"https://github.com/NinjasCL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AirNotifier Moodle Plugin Bridge\n\nA replacement API for https://github.com/airnotifier/airnotifier/[AirNotifier] server for the _AirNotifier Moodle Plugin_ that connects directly to _Firebase_, or others _Push Notification Providers_. This was made since newer versions of _AirNotifier_ seems to be not working with the _Moodle Plugin_ due to usage of old apis. This server implements all needed endpoints and acts as a middleware between _Moodle AirNotifier Plugin_ and _Push Notification Providers_.\n\n## Installation\n\nThis server uses https://nodejs.org/en/[_NodeJS_] instead of _Python_ (Used by _AirNotifier_). Be sure to have _NodeJS_ version \u003e= 10 installed.\n\n- `$ git clone https://github.com/NinjasCL/airnotifier-moodle-bridge`.\n- `$ cd airnotifier-moodle-bridge`.\n- `$ npm install`.\n- `$ npm install -g forever`.\n\nAlso install https://firebase.google.com/docs/libraries[Firebase SDK] to your platform in order to obtain _FCM Token_ or the other Client SDKs needed.\n\n## Configure\n\nYou would need to get the configuration from your https://console.firebase.google.com[firebase console] or other adapters.\nCheck the `index.js` file for each adapter configuration.\n\nAlso the headers `X-An-App-Key` and `X-An-App-Name` should be set in both server config and moodle plugin settings. Is recommended a random value using `npm run uuid` script for `X-An-App-Key`.\n\nBe sure to set the correct server address and port in your _Moodle Plugin Settings_. (Beware of trailing slashes in the server address).\n\nCheck that you can interact with the server. The root endpoint should return a json with the version number.\n\n## Usage\n\n- Start the server with `npm start`.\n- Send `FCM Token`. Not the native token.\n\n- You can also use `npm run forever` to init a background process.\n\n```sh\n\n#!/bin/sh\n\nforever start --minUptime 1000 --spinSleepTime 1000  -o out.log -e err.log index.js\n```\n\n### Example token registration\n\nThis is how you can send from your _Firebase SDK_ instance to your _Moodle_ server.\nYou have to send the _FCM Token_ in the _pushid_ param.\n\nNote: Contains Invalid token values for security purposes.\n\n```\nhttps://my.moodle.site/webservice/rest/server.php?wstoken=skkd1m1m3123km32kkckas3\u0026appid=com.myapp.seed\u0026name=Ninja's%20iPhone\u0026model=iPhone\u0026platform=ios\u0026version=10.3.2\u0026pushid=dWZfI--pSUXygaBKRVAslm:APA91bE-GiFkSCg-r1z-XoOVm-cPoXLd9dbhs3bZjPJb2t8GCCVFzrBE8UmoJSsjGbN2MhRq1MllOfFB_kOlZ1_3jvHaSrqrn7plxH1\u0026uuid=12311-8EC8-4A93-A6C231228\u0026wsfunction=core_user_add_user_device\u0026moodlewsrestformat=json\n```\n\n### Example notification\n\nYou can configure this request in _Postman_ or similar HTTP client.\n\n#### Endpoint \n\n- POST: `http://\u003cip\u003e:3000/api/v2/push`\n\n#### Headers\n\n- X-AN-APP-KEY: `A1159649-4DE0-4449-A8CF-ED0922312BF2`\n- X-AN-APP-NAME: `myapp`\n\n#### Body\n\n- format: `x-www-form-urlencoded`\n- token: `\u003cFCM Token\u003e`\n- extra[smallmessage]: `An small excerpt of the message`\n- extra[sitefullname]: `Who is sending the message`\n- extra[contexturl]: `Where to send the user after notification click`\n\n\n\n## Sponsor https://www.fus-ed.com/[Fused]\n\nThis code was made possible thanks to the folks at https://www.fus-ed.com/[Fused].\n_Fused_ merges decades of performance experience with leading-edge technology.\n\n## Made by https://ninjas.cl[Ninjas.cl]\n\nThis was developed (with :love:) by https://ninjas.cl[Ninjas.cl].\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjascl%2Fairnotifier-moodle-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninjascl%2Fairnotifier-moodle-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjascl%2Fairnotifier-moodle-bridge/lists"}