No description
  • JavaScript 54.6%
  • CSS 22.8%
  • HTML 20%
  • Dockerfile 1.4%
  • Makefile 1.2%
Find a file
2026-10-21 13:23:12 -07:00
dist fix: finish widget forge source references 2026-10-15 15:36:22 +02:00
src fix: finish widget forge source references 2026-10-15 15:36:22 +02:00
build.js inline css 2025-12-21 21:05:09 -08:00
Containerfile initial commit 2025-12-21 20:51:01 -08:00
index.html improve loading and error states 2025-12-22 19:43:28 -08:00
LICENSE Add MIT license 2026-08-24 12:41:54 +02:00
Makefile improve loading and error states 2025-12-22 19:43:28 -08:00
package.json Migrate dependency sources to the Caution forge 2026-10-15 15:36:14 +02:00
README.md fix: finish widget forge source references 2026-10-15 15:36:22 +02:00

Attestation Widget

Embeddable widget for verifying TEE (Trusted Execution Environment) attestation documents.

Installation

npm install git+https://git.caution.co/public/attestation-widget.git

Usage

Modal Mode

import { showModal } from 'attestation-widget';

showModal({
  attestationUrl: '/attestation',
  onVerified: (result) => console.log('Verified!', result),
  onError: (err) => console.error('Failed:', err),
  onClose: () => console.log('Modal closed')
});

Inline Mode

import { renderInline } from 'attestation-widget';

const widget = renderInline('#container', {
  attestationUrl: '/attestation',
  autoVerify: true
});

// Later, destroy the widget
widget.destroy();

Manual Control

import { AttestationWidget } from 'attestation-widget';

const widget = new AttestationWidget({
  attestationUrl: '/attestation',
  mode: 'modal', // or 'inline'
  autoVerify: false
});

widget.render(document.body);
await widget.verify();

console.log(widget.result);

Options

Option Type Default Description
attestationUrl string /attestation URL of the attestation endpoint
mode string modal Display mode: modal or inline
autoVerify boolean true Automatically verify on render
showBanner boolean true Show success/error banner
showVerifyButton boolean true Show "Verify this app" button
showChecks boolean true Show authentication steps
showUserData boolean true Show user data section
showPCRs boolean true Show PCR values
showSources boolean true Show source information
showRaw boolean true Show raw response
onVerified function - Callback on successful verification
onError function - Callback on verification error
onClose function - Callback when modal is closed

CSS

Styles are automatically injected when the widget renders. No separate CSS import is required.

If you prefer to load styles separately (e.g., for SSR or to avoid FOUC), you can link the CSS directly:

<link rel="stylesheet" href="node_modules/attestation-widget/dist/styles.css">

Building

make build

Development

make dev

Then open http://localhost:1337 to view the test page.

Source repository

Canonical source: https://git.caution.co/public/attestation-widget.