master merged
This commit is contained in:
@@ -8,6 +8,11 @@ BFF mínimo para expor flags ao app sem expor `Atomenta-Token` no cliente.
|
||||
- `POST /feature-control/telemetry/exposure`
|
||||
- `GET /health`
|
||||
|
||||
## Notificações
|
||||
|
||||
No momento este BFF cobre apenas Feature Control (`bootstrap` + `exposure`).
|
||||
Para notificações segmentadas por audiência (`todos`, `feature:fc.ios`), precisamos adicionar o contrato de endpoint de notificações do Atomenta para integrar no app.
|
||||
|
||||
## Variáveis de ambiente
|
||||
|
||||
- `PORT` (default: `8787`)
|
||||
@@ -22,8 +27,11 @@ Exemplo de `FEATURE_CONTROL_DEFAULTS_JSON`:
|
||||
|
||||
```json
|
||||
{
|
||||
"fc.checkout_v2": { "enabled": false, "variant": "off" },
|
||||
"fc.search_ranking_v3": { "enabled": true, "variant": "on", "payload": { "model": "v3" } }
|
||||
"fc.promo": { "enabled": true, "variant": "on" },
|
||||
"fc.promo-codes": { "enabled": true, "variant": "on" },
|
||||
"fc.android": { "enabled": true, "variant": "on" },
|
||||
"fc.city-aguai": { "enabled": true, "variant": "on" },
|
||||
"fc.ios": { "enabled": true, "variant": "on" }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -32,7 +40,7 @@ Exemplo de `FEATURE_CONTROL_DEFAULTS_JSON`:
|
||||
```json
|
||||
{
|
||||
"environment": "production",
|
||||
"keys": ["fc.checkout_v2", "fc.search_ranking_v3"],
|
||||
"keys": ["fc.promo", "fc.promo-codes", "fc.android", "fc.city-aguai", "fc.ios"],
|
||||
"context": {
|
||||
"subjectType": "customer",
|
||||
"subjectId": "cust_123",
|
||||
@@ -58,11 +66,14 @@ Se o app enviar `Authorization: Bearer <JWT>`, o BFF tenta extrair `subjectId` d
|
||||
"configVersion": 7,
|
||||
"evaluatedAt": "2026-04-16T12:00:00.000Z",
|
||||
"flags": {
|
||||
"checkoutV2": true,
|
||||
"searchRankingV3": "off"
|
||||
"promo": true,
|
||||
"promoCodes": true,
|
||||
"android": true,
|
||||
"cityAguai": true,
|
||||
"ios": true
|
||||
},
|
||||
"raw": {
|
||||
"fc.checkout_v2": {
|
||||
"fc.promo": {
|
||||
"enabled": true,
|
||||
"variant": "on",
|
||||
"payload": null,
|
||||
@@ -87,3 +98,5 @@ FEATURE_CONTROL_MODULE_TOKEN="550e8400-e29b-41d4-a716-44665544000b" npm start
|
||||
cd feature-control-bff
|
||||
npm test
|
||||
```
|
||||
|
||||
Autor: Daniel Arantes Loverde
|
||||
|
||||
Reference in New Issue
Block a user