Page Trigger
For embedded buttons/forms on your site
Page Trigger lets you embed AgentCraft webhooks directly into your website or app. Unlike User Trigger or Timer Trigger, the Page Trigger runs from your page via our JavaScript SDK. It’s perfect for sign-up fsign-up forms, lead capture forms, or any action a visitor performs on your site.

How It Works
AgentCraft issues a JWT token to the end-user via redirect (URL parameter).
Our JS SDK automatically extracts this token.
When a user submits your form or clicks a button, the SDK sends a
fetch()request to the proxy webhook with the token in theAuthorizationheader.AgentCraft validates the token and forwards the request to your original webhook.
Step 1. Include the AgentCraft SDK
Add our script to your page (before </body> closing tag):
Step 2. Embed a Form with data-agentcraft-webhook
data-agentcraft-webhookWrap your form fields with a form tag and point it to your AgentCraft Page Trigger webhook:
Token Handling
When the user is redirected to your page from AgentCraft, the URL will contain
?agentcraft_token=<JWT>The SDK automatically extracts this token.
The token is then sent as
Authorization: Bearer <token>with each request.

Notes about Page Trigger
No static/dynamic fields. Page Trigger simply proxies everything you send.
Invisible to the end-user. It doesn’t appear in
/end-user/webhookbecause end-users don’t configure it — only you do.Flexible. You can attach it to forms, buttons, or custom JS events.
Debugging Responses
Include a <div data-agentcraft-result></div> inside your form.
The SDK will automatically populate it with the webhook response (JSON or text).
Typical Use Cases
Signup / lead forms
In-page actions (like “Generate Report” buttons)
Lightweight API calls on behalf of a logged-in user
Last updated