# Event evidence

> API type: event. Verify a signup, purchase, install or another named product event.

Source: https://dashboard.adquest.batriders.ir/docs/quest-evidence/event · Audience: Developers · Section: Quest evidence

## SDK event proof

Start a session, then ingest the event after the named action actually occurs. session.ingestEvent attaches the session’s delivery token. Use a stable event ID for retries and a Unix timestamp in seconds represented as a string.

**SDK-source event**

```typescript
const session = await client.startQuest(questId, { requiresTimer: false });
// Store eventId with this real action; reuse it if the request is retried.
const eventId = crypto.randomUUID();
await session.ingestEvent({
  eventId,
  eventName: "signup_completed", // Must match the configured rule.
  source: "sdk",
  timestamp: String(Math.floor(Date.now() / 1000)),
});
const completion = await questRequest(config, questId, "complete");
```

## Server event proof

After your backend verifies the product action, calculate a lowercase hex HMAC-SHA256 signature over event_id.event_name.quest_id.external_user_id.timestamp. Use the exact normalized event name and timestamp that you send. Post to /platform/quests/{questId}/events with the public platform key, participant token and the signed payload.

**Node.js — server only**

```typescript
import { createHmac } from "node:crypto";

const timestamp = String(Math.floor(Date.now() / 1000));
const signature = createHmac("sha256", eventSigningSecret)
  .update([eventId, eventName, String(questId), externalUserId, timestamp].join("."))
  .digest("hex");
await questRequest(config, questId, "events", {
  event_id: eventId, event_name: eventName,
  source: "server", timestamp, signature,
});
```

> **Accepted event versus completed quest.** Event ingestion records verified evidence. Submit completion and check the settlement response before crediting your own app. Invalid signatures, expired windows, wrong names and disallowed sources must remain failures.

## Next steps

- [Quest evidence overview](https://dashboard.adquest.batriders.ir/docs/quest-evidence): The shared request helper and the completion flow.
- [Quest actions API](https://dashboard.adquest.batriders.ir/docs/api/quest-actions): Every request and response.
- [Set up this quest in the dashboard](https://dashboard.adquest.batriders.ir/docs/dashboard/quests/event): For publishers: configure and publish the quest.
