dataemergencia / emergency-bff
Backend-for-frontend for the DataEmergencia emergency module.
Requires
- php: ^8.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.9
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/log: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Backend for frontend (BFF) for the DataEmergencia emergency and alert flow.
The BFF sits between the browser panel and the DataEmergencia API. It receives a browser request, validates the identity code, applies the emergency rules and calls the upstream API with credentials that stay on the server. Its purpose is the security boundary: the API key, the application identifier and the WhatsApp flow never reach the browser, and one server-side component owns the emergency state.
It is not a payload translator and not a full application. Your application owns the front controller, the web server and the session backend. Realtime delivery events are published by the DataEmergencia API; this package exposes no Pusher configuration.
Requirements
- PHP 8.4 or newer
- Composer 2.x
- One API key and application identifier per deployment, issued by DataEmergencia
The required PHP extensions are declared in composer.json and checked by
Composer during installation.
Install
composer require dataemergencia/emergency-bff
Documentation
| Read | When |
|---|---|
| Zero to panel | First integration, from empty directory to panel |
| HTTP contract | Calling the BFF from a frontend |
| Activation flow | Understanding what happens between SOS and WhatsApp |
| Configuration | Wiring credentials and runtime behavior |
| Session and CSRF | Hosting the BFF in an existing PHP application |
| Security | Threat model, trust boundaries, known limitations |
| Troubleshooting | Diagnosing a failing deployment |
| Upgrade | Moving between releases |
| Releasing | Publishing a version (maintainers) |
The full index is docs/README.md.
Browser panel
Use @dataemergencia/emergency
for the SOS panel. It consumes this backend and owns geolocation, the SOS
interaction and the fallback phone number.
Maintenance
Maintained by Sistemas SCAEM C.A. Source and issues:
The-BoxHead-Guy/emergency-bff.
License
MIT. See LICENSE.