EdgeInteract
Confirmation
The confirmation interaction type presents a binary (confirm/cancel) or ternary (confirm/cancel/third) choice to a user before a significant action is executed. It is designed for destructive, irreversible, or consequential operations.
When to Use
- Deleting records or accounts
- Overwriting data or publishing to production
- Sending bulk communications
- Acknowledging a terms change before proceeding
- Any action where "are you sure?" is the right question
Live Mockup — Danger Confirmation
Delete All Test Records
This will permanently delete 1,482 test records from the production database. This action cannot be undone.
Live Mockup — Ternary (Third Option)
Deploy to Production?
Build v3.2.1 has passed all staging checks. Would you like to deploy to production now or schedule for off-hours?
Severity Levels
info
warning
danger
The severity field controls the visual styling of the confirmation dialog. Use danger for destructive actions, warning for consequential ones, and info (default) for neutral confirmations.
Request Payload Schema
interface ConfirmationPayload {
/** The question or warning message shown to the user */
message: string;
/** Label for the confirm button (default: "Confirm") */
confirmLabel?: string;
/** Label for the cancel button (default: "Cancel") */
cancelLabel?: string;
/** Visual severity: 'info' | 'warning' | 'danger' (default: 'info') */
severity?: 'info' | 'warning' | 'danger';
/** Optional third option (e.g., "Schedule", "Remind me later") */
thirdOption?: {
label: string; // button label
outcome: string; // outcome string returned when clicked
};
}
Full Request Example (Ternary)
const response = await sendInteraction({
type: 'confirmation',
targetUserId: currentUserId,
title: 'Deploy to Production?',
payload: {
message: 'Build v3.2.1 has passed all staging checks. Deploy to production now or schedule for off-hours?',
confirmLabel: 'Deploy Now',
cancelLabel: 'Cancel',
severity: 'warning',
thirdOption: {
label: 'Schedule',
outcome: 'scheduled'
}
},
timeoutMs: 120_000 // 2 minutes
});
switch (response.outcome) {
case 'confirmed': await deployNow(buildId); break;
case 'scheduled': await scheduleDeploy(buildId); break;
case 'cancelled': /* do nothing */ break;
}
Response Schema
interface ConfirmationResponse {
interactionId: string;
respondedBy: string;
outcome: 'confirmed' | 'cancelled' | string; // 'string' for thirdOption outcomes
data: {}; // empty for confirmation type
timestamp: string;
}
Validation Rules
| Field | Rule |
|---|---|
payload.message | Required, max 2000 characters |
payload.confirmLabel | Optional, max 50 characters |
payload.cancelLabel | Optional, max 50 characters |
payload.severity | Optional; must be one of: info, warning, danger |
payload.thirdOption.outcome | Must not be 'confirmed' or 'cancelled' (reserved) |
response.outcome | Must be 'confirmed', 'cancelled', or a registered thirdOption outcome |
Self-Targeting is Common
Confirmation interactions are often sent to the same user who triggered the action —
targetUserId: currentUserId. This creates a blocking "are you sure?" step where the action only executes after the user explicitly confirms.