Dantai/ DocsOpen app
5 min read

Webhooks and variables

Dantai talks to n8n, GitHub and WhatsApp through webhooks. Each address has a default for local work and a variable to change it.

n8n webhooks

The website calls these from the browser. Locally they default to http://localhost:5678/webhook/<name>.

VariablePathWhat it does
VITE_N8N_WEBHOOKsmartauditServes chat, scans and repository files.
VITE_N8N_IMPORTimport-tasksReads an Excel, CSV or public Google Sheet and creates the rows as tasks.
VITE_N8N_TICKET_CREATEticket-createNew ticket (Slack): saves it and posts it to Slack.
VITE_N8N_TICKET_CREATE_JIRAticket-create-jiraNew ticket when Jira is the destination: creates the issue and saves it.
VITE_N8N_TICKET_CREATE_CLICKUPticket-create-clickupNew ticket when ClickUp is the destination.
VITE_N8N_TICKET_CLOSEticket-closeReplies on the Jira, ClickUp or Slack ticket and closes it when its task is done.
VITE_N8N_SLACK_SYNCslack-syncThe Tickets Refresh button: pulls Slack channel messages in.
VITE_N8N_JIRA_SYNCjira-syncThe Tickets Refresh button: pulls Jira issues in.
VITE_N8N_CLICKUP_SYNCclickup-syncThe Tickets Refresh button: pulls ClickUp tasks in.

Change an address

Put the real address in .env.local, which git ignores. For a deployed site, set the same names as build variables instead: see Self-hosting.

Point the site at another n8n

Add only the lines you need to .env.local, then restart npm run dev.

.env.local
VITE_N8N_WEBHOOK=https://your-n8n.example.com/webhook/smartaudit
VITE_N8N_TICKET_CREATE=https://your-n8n.example.com/webhook/ticket-create
VITE_N8N_SLACK_SYNC=https://your-n8n.example.com/webhook/slack-sync

GitHub push webhook

This is how a push reaches Dantai. GitHub calls PocketBase, which checks the signature and queues the push.

  1. Set a secret on PocketBase

    Generate a long random string and set it as LYNX_GITHUB_WEBHOOK_SECRET. Without it the webhook answers 503.

  2. Add the webhook in GitHub

    Repository → Settings → Webhooks → Add webhook, with these values:

    FieldValue
    Payload URL<your PocketBase address>/api/lynx/github-webhook
    Content typeapplication/json
    SecretThe same string as LYNX_GITHUB_WEBHOOK_SECRET
    EventsJust the push event
  3. For the Pipelines page, add more events

    Choose Let me select individual events and tick Pushes, Workflow runs and Workflow jobs. A job event only says which run changed: the steps are always read from the GitHub API, so the saved GitHub token must be able to read Actions.

WhatsApp

WhatsApp is a separate service with its own variables, because it runs next to n8n, not in the website.

WhereVariableMeaning
WhatsApp APIWEBHOOK_URLThe n8n whatsapp-comms webhook that receives messages and delivery receipts.
WhatsApp APIWEBHOOK_SECRETSent as the x-webhook-secret header so n8n can refuse anyone else.
WhatsApp APIAPI_KEYCallers send it as the x-api-key header.
PocketBaseLYNX_WHATSAPP_SEND_URLThe n8n whatsapp-comms-send webhook, used to send replies.
PocketBaseLYNX_WHATSAPP_API_URLWhere the WhatsApp API is.
PocketBaseLYNX_WHATSAPP_API_KEYMust equal the API's API_KEY.
PocketBaseLYNX_COMMS_SECRETShared with the n8n WhatsApp workflows.

Check it works

Is PocketBase up?

Answers with a short JSON message when it is healthy.

Is PocketBase up?
curl -i http://127.0.0.1:8090/api/health

Is n8n up?

Any answer means n8n is listening. Open it in a browser to see your workflows.

Is n8n up?
curl -I http://localhost:5678

Watch the hooks while you try something

A webhook that does nothing usually says why here.

Watch the hooks while you try something
docker compose logs -f pocketbase n8n

Where next