SDK Constants

This guide provides developers with an understanding of the constants exposed in DottedSign Embedded Signing SDK. These constants represent fixed values used throughout the SDK, providing a way to reference values without hardcoding them into your application.

Currently, there are two constant types: EMBED_TYPE and ELEMENTS_ID. Each constant type offers several items for users to utilize. You can reference them using the following syntax:

window.dottedSign.embedTypes.<CONSTANT_NAME>
window.dottedSign.elementsId.<CONSTANT_NAME>

EMBED_TYPE

EMBED_TYPE represents the various embedding modes provided by DottedSign Embedded Signing SDK.

Constant NameDescription
CREATEThe mode to create a task from scratch by uploading documents.
DRAFTThe mode to create a task from an existing draft by providing a draft ID.

CREATE

The CREATE embed type is used to create a new task.

  • If no templateId is provided, the SDK will follow the standard task creation flow (upload documents or start from scratch).
  • If a templateId is provided, the task will be created directly from the specified template.

Example: Create a task without a template

window.dottedSign.open(root, {
  token,
  type: window.dottedSign.embedTypes.create,
});

Example: Create a task with a template

window.dottedSign.open(root, {
  token,
  type: window.dottedSign.embedTypes.create,
  templateId: `${Your template ID}`,
});

DRAFT

The DRAFT embed type allows users to create a task based on an existing draft.

When using this mode, you must provide a valid draftId. The embedded signing flow will load the draft and continue task creation from it.

Example: Create a task from a draft

window.dottedSign.open(root, {
  token,
  type: window.dottedSign.embedTypes.draft,
  draftId: `${Your draft ID}`,
});

ELEMENTS_ID

ELEMENTS_ID specifies the HTML elements that will be displayed in the user interface. Its primary purpose is to allow users to toggle components, for example, using the hideElement() method.

CREATE

The following ELEMENTS_ID constants are available for use in the CREATE embedding mode, corresponding to the UI components shown below.

Constant NameDescription
CREATE_ATTACHMENTS06-embedded-signing-create-attachment.png
CREATE_PREVIEW06-embedded-signing-create-preview.png
CREATE_CONFIRM_LABEL06-embedded-signing-create-corfirm-label.png