Skip to main content

TranscryptsOptions

Configuration object passed to the Transcrypts constructor.
interface TranscryptsOptions {
  apiKey: string;
  widgetUrl?: string;
  containerStyle?: Partial<CSSStyleDeclaration>;
}

Properties

PropertyTypeRequiredDefaultDescription
apiKeystringYesYour Transcrypts API key. Must be a non-empty string.
widgetUrlstringNo'https://widget.transcrypts.com'Custom widget URL.
containerStylePartial<CSSStyleDeclaration>NoSee default styles belowCustom CSS styles applied to the overlay container <div> that wraps the widget iframe.

Default Container Styles

When no containerStyle is provided, the overlay container uses the following defaults:
CSS PropertyDefault Value
positionfixed
top0
left0
width100%
height100%
zIndex999999
backgroundColorrgba(0, 0, 0, 0.5)
displayflex
alignItemscenter
justifyContentcenter
Any properties set in containerStyle are merged on top of these defaults.

VerifyOptions

Options passed to the verify() method.
interface VerifyOptions {
  ssn: string;
  user?: {
    firstName?: string;
    lastName?: string;
    email?: string;
  };
}

Properties

PropertyTypeRequiredDescription
ssnstringYesThe user’s Social Security Number.
userobjectNoPre-fill user information in the widget.
user.firstNamestringNoUser’s first name.
user.lastNamestringNoUser’s last name.
user.emailstringNoUser’s email address.

VerificationResult

Object returned by verify() on successful resolution.
interface VerificationResult {
  success: boolean;
  verified: boolean;
  userId?: string;
  verificationId?: string;
  workExperience?: WorkExperience[];
  error?: {
    code: string;
    message: string;
  };
}

Properties

PropertyTypeRequiredDescription
successbooleanYestrue if the verification flow completed successfully.
verifiedbooleanYestrue if the user’s employment was verified.
userIdstringNoThe unique identifier for the verified user.
verificationIdstringNoA unique opaque identifier for the verification.
workExperienceWorkExperience[]NoArray of verified work experience records. Present when verification succeeds.
errorobjectNoError details. Present when the verification did not complete successfully.
error.codestringYes*Machine-readable error code (e.g., 'USER_CLOSED'). *Required when error is present.
error.messagestringYes*Human-readable error description. *Required when error is present.

WorkExperience

A single work experience record returned as part of a successful verification.
interface WorkExperience {
  id: string;
  companyName: string;
  position: string;
  startDate: string;
  endDate?: string;
  isCurrentJob: boolean;
  verified: boolean;
}

Properties

PropertyTypeRequiredDescription
idstringYesUnique identifier for this work experience record.
companyNamestringYesName of the employer.
positionstringYesJob title or position held.
startDatestringYesEmployment start date as an ISO 8601 date string.
endDatestringNoEmployment end date as an ISO 8601 date string. Absent if currently employed.
isCurrentJobbooleanYestrue if this is the user’s current position.
verifiedbooleanYestrue if this specific work experience record was verified.

TranscryptsEvent

Event object emitted by the widget and delivered to on() callbacks.
interface TranscryptsEvent {
  type: TranscryptsEventType;
  payload?: Record<string, unknown>;
}

Properties

PropertyTypeRequiredDescription
typeTranscryptsEventTypeYesThe event type identifier.
payloadRecord<string, unknown>NoArbitrary event data. Shape depends on event type.

TranscryptsEventType

A union of string literal types representing all widget event types.
type TranscryptsEventType =
  | 'ready'
  | 'loaded'
  | 'verification_started'
  | 'verification_complete'
  | 'verification_failed'
  | 'close';

Event Types

ValueDescription
'ready'The widget iframe has initialized and is ready to receive input.
'loaded'The widget UI has fully loaded.
'verification_started'The user has initiated the verification process.
'verification_complete'Verification completed successfully. Payload contains the result.
'verification_failed'Verification failed. Payload contains error details.
'close'The user closed the widget via the widget’s close button.