Get Notified When Someone Views Your Deal Room
Set up webhooks to receive real-time alerts when prospects view your documents.
This is the most common VantageKit integration — know the moment a prospect opens your deal room so you can follow up at exactly the right time.
What you'll build
A webhook endpoint that receives deal_room.viewed events and can trigger actions like:
- Sending a Slack notification to your sales team
- Updating your CRM with engagement data
- Triggering a follow-up email sequence
Prerequisites
- A VantageKit account on the Scale plan
- A publicly accessible HTTPS endpoint (see testing locally if you're developing)
1. Create your webhook endpoint
Build a simple Express.js server that receives and verifies webhook events:
import express from 'express'
import crypto from 'node:crypto'
const app = express()
app.use(express.raw({ type: 'application/json' }))
const WEBHOOK_SECRET = process.env.VANTAGEKIT_WEBHOOK_SECRET
app.post('/webhooks/vantagekit', (req, res) => {
// 1. Verify the signature
const signature = req.headers['x-vantagekit-signature']
const timestamp = req.headers['x-vantagekit-timestamp']
const body = req.body.toString()
const expected = crypto
.createHmac('sha256', WEBHOOK_SECRET)
.update(`${timestamp}.${body}`)
.digest('hex')
const isValid = crypto.timingSafeEqual(
Buffer.from(signature.replace('sha256=', '')),
Buffer.from(expected)
)
if (!isValid) {
return res.status(401).send('Invalid signature')
}
// 2. Reject stale timestamps (> 5 minutes old)
const age = Math.floor(Date.now() / 1000) - Number(timestamp)
if (age > 300) {
return res.status(401).send('Timestamp too old')
}
// 3. Process the event
const event = JSON.parse(body)
if (event.type === 'deal_room.viewed') {
const { dealRoomId, viewerEmail, duration, timestamp: viewTime } = event.data
console.log(`${viewerEmail ?? 'Anonymous'} viewed deal room ${dealRoomId}`)
// Send to Slack, update CRM, etc.
}
res.status(200).send('OK')
})
app.listen(3000)2. Register the webhook in VantageKit
- Go to Settings > Webhooks in your dashboard
- Click Create Webhook Endpoint
- Enter your endpoint URL (e.g.,
https://yourapp.com/webhooks/vantagekit) - Select the events you want:
deal_room.viewed,document.viewed - Copy the signing secret — you'll need it to verify signatures
3. Related events
For complete viewer tracking, subscribe to these events:
| Event | When it fires |
|---|---|
deal_room.viewed | Someone views any page in the deal room |
document.viewed | Someone views a specific document (includes pages viewed and duration) |
viewer.identified | A viewer is identified by email or name |
viewer.email_captured | A viewer enters their email (e.g., via email gate) |
document.downloaded | A viewer downloads a document |
See the full event catalog for all 21 event types and their payloads.