File size: 1,628 Bytes
4450d7e
 
 
 
 
 
 
 
 
0e84a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
tags:
  - openclaw
  - sidecar
  - meta
  - fastapi
---

# OpenClaw Meta Bridge

FastAPI sidecar for Meta Page and Messenger workflows. It normalizes Meta webhooks, stores inbound events and drafts, exposes approval-gated tools, and keeps public sends behind explicit human approval.

## Features

- Meta webhook verification and signature validation.
- Configurable Page contexts through environment variables.
- Draft creation for Messenger, comments, Page posts, and Reels.
- Validation-only lanes for Page posts and Reels.
- Read-only Page operations endpoints for posts, media, insights, settings, conversations, and comment threads.
- SQLite-backed audit log and draft lifecycle.

## Configuration

Copy `.env.example` to `.env` and fill in real values. Keep `.env` private.

Page contexts are configured with `META_PAGE_CONTEXTS`, then per-page env vars:

```bash
META_PAGE_CONTEXTS=healthcare,civic
META_PAGE_ID_HEALTHCARE=...
META_PAGE_TOKEN_HEALTHCARE=...
META_PAGE_NAME_HEALTHCARE="Example Health Services"
```

The public repo intentionally uses generic sample contexts. Rename contexts and risk rules for your own deployment.

## Local Development

```bash
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pytest
uvicorn app.main:app --reload --port 8090
```

## Safety Notes

- Do not commit `.env`, database files, webhook payload archives, logs, Page tokens, Page IDs from private deployments, or screenshots containing private conversations.
- Publishing endpoints require `approved_by`; validation-only mode is available for dry runs.
- Unknown Page IDs fail closed.