Signing Widget

Signeum provides a signing widget that handles the complete signing experience — PDF viewing, signature capture, form fields, BankID authentication, OTP verification, and chat. There are two ways to use it:

Mode How it works Best for
Hosted page Redirect signers to Signeum's signing page using the signing URL Quick integration, email-based signing flows
Embedded widget Load the widget JavaScript and mount it in your own page Seamless in-app signing, full control over the experience

Both modes use the same signing token and support all signing methods (drawn, typed, BankID), project branding, and real-time status updates.

Hosted Signing Page

The simplest integration. When you create a document via the API, the response includes a signingUrls array with a unique URL per participant. Redirect or link the signer to their URL — Signeum handles everything else.

201 Document creation response (excerpt)
{
  "signingUrls": [
    {
      "participantId": "p1a2b3c4-...",
      "name": "Anna Lindström",
      "email": "[email]",
      "role": "signer",
      "signingUrl": "https://app.signeum.se/sign/abc123def456..."
    }
  ]
}

The hosted page automatically applies your project's branding (logo, colors, company name) and handles the full signing flow including post-signing behavior.

Tip

If you have email notifications enabled on the project, Signeum sends invitation emails with the signing link automatically. You only need to use the signing URLs directly if you've disabled email notifications (e.g. for white-label email flows).

Embedded Widget

For a seamless in-app experience, load the Signeum widget script and mount it in a container element on your page. The widget renders the full signing UI inside your application.

1. Include the script and stylesheet

HTML Add to your page
<link rel="stylesheet" href="https://cdn.signeum.se/signeum-widget.css">
<script type="module">
  import { init } from 'https://cdn.signeum.se/signeum-widget.js';

  const widget = init({
    containerId: 'signeum-widget',
    token: 'abc123def456...',
    onComplete: (result) => {
      console.log('Signed!', result.documentId, result.status);
    },
    onError: (error) => {
      console.error('Error:', error.code, error.message);
    },
  });

  // To unmount later:
  // widget.destroy();
</script>

2. Add a container element

HTML Container
<div id="signeum-widget" style="width: 100%; height: 700px;"></div>

Options

Option Type Required Description
containerId string Yes ID of the DOM element to mount the widget in
token string Yes Signing token from the signingUrls response
baseUrl string No API base URL. Defaults to https://api.signeum.se
onComplete function No Called when the participant completes signing. Receives { documentId, status }
onError function No Called on errors. Receives { code, message }

The init() function returns an object with a destroy() method to unmount the widget and clean up resources.

Integration Flow

Regardless of which mode you choose, the integration follows the same pattern:

FLOW Step by step
1. Create a document via the REST API
   POST /organizations/:orgId/projects/:projectId/documents
   → Response includes signingUrls with a token per participant

2. Present the signing experience
   Option A: Redirect signer to the signingUrl (hosted page)
   Option B: Extract the token and pass it to the embedded widget

3. Signer completes the flow
   The widget handles PDF viewing, signature capture, fields,
   BankID, OTP, and submission

4. Receive status updates
   Via webhook (configured on project level) or the onComplete callback (embedded)
   Or poll GET /documents/:id for status

Extracting the token from a signing URL

If you're using the embedded widget, you need the token from the signing URL. The token is the last path segment:

JS Extract token
const signingUrl = "https://app.signeum.se/sign/abc123def456...";
const token = signingUrl.split('/sign/')[1];
// → "abc123def456..."

Customization

The widget's appearance is controlled by project settings. Configure these in the Signeum dashboard or via the API. All customization applies to both hosted and embedded modes.

Branding

Setting Effect
Logo URL Displayed in the signing page header
Header color Background color/gradient for the page header
Button color Primary action button color in the widget
Background color Widget background
Font family Custom font for all widget text
Font color Text color throughout the widget

Feature toggles

Setting Default Effect
Chat Enabled Allow participants to send messages during signing
Welcome modal Enabled Show an introductory modal when the signer opens the widget
Email notifications Enabled Send invitation and status emails to participants
Audit log in PDF Enabled Embed the audit trail in the final signed PDF

Callbacks & Events

There are two ways to track what happens during and after signing:

Widget callbacks (embedded mode)

The onComplete and onError callbacks fire in the browser when the participant finishes or encounters an error.

JS Callback example
init({
  containerId: 'signeum-widget',
  token: signingToken,
  onComplete: (result) => {
    // result.documentId — the document UUID
    // result.status — "completed" when all have signed
    showSuccessMessage();
  },
  onError: (error) => {
    // error.code — e.g. "EXPIRED", "CANCELLED"
    // error.message — human-readable description
    showErrorMessage(error.message);
  },
});

Webhooks (server-side)

For reliable server-to-server notifications, configure a callbackUrl in your project settings. Signeum sends POST requests for all document lifecycle events, for documents created both via the API and the UI. See the Webhooks section in the API docs for the full event list and payload format.

Recommendation

Use webhooks for any business logic (updating your database, triggering workflows). Use widget callbacks for UI updates (showing a success screen, navigating to the next step).

Post-signing Behavior

Control what happens after a participant signs. This is configured at the project level and applies to the hosted signing page.

Mode Behavior
confirmation Show a default "signing complete" confirmation screen (default)
custom_message Show a custom message you define in the project settings
redirect Redirect the signer to a URL. Supports {documentId} placeholder

For the embedded widget, use the onComplete callback to control the post-signing experience in your own application.