백엔드와 SDK

웹훅

앱 이벤트를 쓰고 있는 다른 도구나 내 서버로 보내요.

빌더에서 설정 → 웹훅(고급 설정 안)을 열고 엔드포인트 URL을 붙여 넣은 다음 저장하세요 (Starter 요금제 이상). 그러면 builder77이 이벤트마다 JSON 본문이 담긴 POST를 보내요.

이벤트시점
record.created앱이 레코드를 만들었을 때
record.updated레코드가 수정되었을 때
record.deleted레코드가 삭제되었을 때
user.signed_up누군가 앱에 가입했을 때
test.ping“테스트 이벤트 보내기”를 클릭했을 때
{
  "event": "record.created",
  "projectId": "abc123",
  "timestamp": "2026-10-01T10:00:00.000Z",
  "collection": "orders",
  "record": { "id": "…", "total": 42, "createdAt": "…" }
}

요청 검증하기

모든 요청에는 X-M77-Signature 헤더가 있어요. 서명용 비밀 키(설정에 표시됨)으로 원본 본문을 HMAC-SHA256 처리한 16진수 값이에요.

import crypto from 'node:crypto';
const expected = crypto.createHmac('sha256', process.env.M77_WEBHOOK_SECRET).update(rawBody).digest('hex');
if (expected !== req.headers['x-m77-signature']) return res.status(401).end();

웹훅은 8초 제한 시간으로 한 번 전송돼요. URL은 공개 주소여야 해요 (사설 네트워크 주소는 차단돼요).