Type Reference
Every type the Embedded SDK exposes to your application, in one place. Copy the declarations below into your project if you want typed callbacks and mount options.
These are the only SDK types you need. The SDK also uses an internal
postMessage protocol to talk to the iframe it embeds, but your application
never sends, receives, or annotates those messages — they are not part of the
integration surface and are not documented here.
For prose, examples, and validation rules, see SDK Methods and Lifecycle Events.
The global object
The SDK is loaded via a <script> tag and exposes a single global. These three
members are everything on it:
declare const Intellirent: {
/** Create an SDK instance — see SDK Methods */
init(config: SdkConfig): IntellirentSDK;
/** The loaded SDK's version string, e.g. "0.10.4" */
version: string;
/** Enumerated error codes — see Error codes below */
SdkErrorCode: typeof SdkErrorCode;
};
Because the SDK ships as a browser global rather than a module you import, the
declarations on this page are not importable — copy the ones you need into your
own .d.ts file.
Initialization
Intellirent.init(config) takes an SdkConfig and returns an IntellirentSDK.
See SDK Methods and, for sessionToken /
onTokenExpired, Session Tokens.
interface SdkConfig {
/** Publishable API key (pk_live_* or pk_test_*) */
publishableKey: string;
/** User identity and role, for access control */
userContext: UserContext;
/** Single-use token minted server-side; see Session Tokens */
sessionToken?: string;
/** Called once if a supplied sessionToken was rejected as expired; see Session Tokens */
onTokenExpired?: () => Promise<string | undefined> | string | undefined;
}
interface UserContext {
/** Stable identifier from your auth system (e.g. Cognito sub, Auth0 user_id) */
userId: string;
/** Role of the user for the mounted view */
userType: SdkUserType;
/** Display name, shown in the UI — never used for authentication */
displayName?: string;
/** Email address, shown in the UI — never used for authentication */
email?: string;
}
type SdkUserType = "CONSUMER" | "END_USER" | "TSP";
The SDK instance
interface IntellirentSDK {
/** Mount a view into the element matched by `selector` */
mount(selector: string, options?: MountOptions): Promise<IframeInstance>;
/** Unmount the current view; the instance can mount again afterwards */
unmount(): void;
/** Tear down the instance permanently — further mount() calls throw */
destroy(): void;
/** Subscribe to a lifecycle event; returns an unsubscribe function */
on<T extends LifecycleEventType>(
event: T,
listener: LifecycleEventListener<T>,
): () => void;
/** Remove a previously registered listener */
off<T extends LifecycleEventType>(
event: T,
listener: LifecycleEventListener<T>,
): void;
}
interface IframeInstance {
/** Unique instance identifier */
readonly id: string;
/** Remove the iframe and clean up its resources */
destroy(): void;
}
Mount settings
Passed as the second argument to sdk.mount(). See
Mount Options for per-option detail and
Available Views for which options each view
requires.
interface MountOptions {
/** Which view to display; defaults to 'screening' */
view?: SdkView;
/** Screening-view options; used when view is 'screening' or omitted */
screening?: ScreeningOptions;
/** Report-view options; required when view is 'report' */
report?: ReportOptions;
onReady?: () => void;
onError?: (error: SdkError) => void;
onWarning?: (warning: SdkWarning) => void;
onResize?: (dimensions: ResizeDimensions) => void;
onChange?: (field: string) => void;
onStepStart?: (step: string) => void;
onStepComplete?: (step: string) => void;
onVerificationSuccess?: (result: VerificationResult) => void;
onVerificationFailure?: (failure: VerificationFailure) => void;
onScreeningSuccess?: (result: ScreeningResult) => void;
onPaymentSuccess?: (result: PaymentResult) => void;
onReportShared?: (event: ReportSharedEvent) => void;
onReportRevoked?: (event: ReportRevokedEvent) => void;
/** Takes over printing — see Takeover Handlers (Native WebViews) */
handlePrintRequested?: () => void;
/** Takes over file downloads — see Takeover Handlers (Native WebViews) */
handleDownloadRequested?: (download: DownloadRequest) => void;
}
type SdkView = "screening" | "reports" | "report" | "dashboard";
interface ScreeningOptions {
/** Pre-populate form fields with applicant data you already hold */
prefill?: ScreeningPrefillData;
/** Rental property address; required when userType is not 'END_USER' (i.e. 'CONSUMER' or 'TSP') */
unitAddress?: UnitAddress;
/** Application fee override in cents (integer, 1–1,000,000) */
applicationFee?: number;
/** END_USER category; skips the wizard's category-selection screen */
endUserType?: EndUserCategory;
/** Experian report bundle override for this session */
productId?: ProductId;
}
type ProductId = 9 | 34 | 36 | 38 | 51 | 52 | 68 | 71 | 72 | 73 | 74;
type EndUserCategory = "INDEPENDENT_OWNER" | "REAL_ESTATE_AGENT" | "PROPERTY_MANAGEMENT";
interface ReportOptions {
/** UUID of the screening report to display */
id: string;
}
/** Payload delivered to the `handleDownloadRequested` takeover handler */
interface DownloadRequest {
/** Short-lived presigned URL — self-authenticating, GET it without extra credentials */
url: string;
/** Suggested filename for the saved file */
filename: string;
}
interface UnitAddress {
street: string;
street2?: string;
unit?: string;
city: string;
/** 2-letter state code */
state: string;
/** 5-digit, ZIP+4, or 9-digit ZIP */
zip: string;
}
ScreeningPrefillData
All fields are optional — pass only what you have. See Screening Pre-fill for per-field format rules and for the fields that deliberately cannot be pre-filled.
interface ScreeningPrefillData {
firstName?: string;
middleName?: string;
noMiddleName?: boolean;
lastName?: string;
email?: string;
phone?: string;
phoneType?: "home" | "mobile" | "work";
dateOfBirth?: string;
ssn?: string;
currentStreet?: string;
currentStreet2?: string;
currentCity?: string;
currentState?: string;
currentZip?: string;
previousStreet?: string;
previousStreet2?: string;
previousCity?: string;
previousState?: string;
previousZip?: string;
}
Callback payloads
The objects your MountOptions callbacks receive. See
Callback Details for when each one fires.
interface SdkError {
/** Stable error code — match on this, never on message */
code: string;
/** Human-readable message; wording may change between releases */
message: string;
/** Whether retrying may succeed */
recoverable?: boolean;
}
interface SdkWarning {
code: string;
message: string;
/** Field names that triggered the warning */
invalidFields?: string[];
}
interface ResizeDimensions {
width: number;
height: number;
}
interface VerificationResult {
/** UUID of the screening session */
id?: string;
/** @deprecated Always "" — the real value is never sent. Use `id`. */
screeningId: string;
userType: SdkUserType;
/** Live publishable key issued after END_USER enrollment */
liveKey?: string;
/** Test publishable key issued after END_USER enrollment */
testKey?: string;
}
interface VerificationFailure {
/** Machine-readable failure reason */
reasonCode: string;
/** @deprecated Always "" — the real value is never sent. */
screeningId: string;
}
interface ScreeningResult {
/** UUID of the screening report — store this to mount the report view */
id?: string;
userType: SdkUserType;
/** @deprecated Always "" — the real value is never sent. Use `id`. */
screeningId: string;
}
interface PaymentResult {
/** Stripe transaction ID */
transactionId: string;
/** Amount charged, in cents */
amount: number;
}
interface ReportSharedEvent {
/** UUID of the screening session */
reportId: string;
/** ISO 8601 timestamp when sharing was consented */
sharedAt: string;
}
interface ReportRevokedEvent {
/** UUID of the screening session */
reportId: string;
/** ISO 8601 timestamp when sharing was revoked */
revokedAt: string;
}
Error codes
Intellirent.SdkErrorCode is a constant object of the codes the SDK enumerates.
Only PAYMENT_REQUIRED is currently delivered to onError; the other two are
reserved and never emitted. See
Callback Details for the full set of codes
onError can deliver — most of the codes it actually emits at runtime, including
every token-exchange code, are not on this object.
declare const SdkErrorCode: {
readonly PAYMENT_REQUIRED: "PAYMENT_REQUIRED";
/** Reserved — never delivered to onError */
readonly VALIDATION_INVALID_FORMAT: "VALIDATION_INVALID_FORMAT";
/** Reserved — never delivered to onError */
readonly INVALID_PUBLISHABLE_KEY: "INVALID_PUBLISHABLE_KEY";
};
type SdkErrorCode = (typeof SdkErrorCode)[keyof typeof SdkErrorCode];
Lifecycle events
Used with sdk.on() / sdk.off(). See Lifecycle Events for the
event order, usage patterns, and a React example.
type LifecycleEventType =
| "mounting"
| "mounted"
| "unmounting"
| "unmounted"
| "destroying"
| "destroyed"
| "component_loaded"
| "component_ready"
| "component_error"
| "component_destroyed";
/** Maps each event name to the payload its listener receives */
interface LifecycleEventMap {
mounting: MountEventPayload;
mounted: MountEventPayload;
unmounting: UnmountEventPayload;
unmounted: UnmountEventPayload;
destroying: DestroyEventPayload;
destroyed: DestroyEventPayload;
component_loaded: ComponentLoadedPayload;
component_ready: ComponentReadyPayload;
component_error: ComponentErrorPayload;
component_destroyed: ComponentDestroyedPayload;
}
type LifecycleEventListener<T extends LifecycleEventType> = (
payload: LifecycleEventMap[T],
) => void;
Event payloads
interface MountEventPayload {
/** CSS selector where the iframe is being mounted */
selector: string;
/** Instance ID — only present on the 'mounted' event */
instanceId?: string;
}
interface UnmountEventPayload {
selector: string;
instanceId: string;
}
interface DestroyEventPayload {
/** Whether an iframe was mounted when destroy() was called */
hadMountedIframe: boolean;
}
interface ComponentLoadedPayload {
/** Component type (e.g. 'consumer_screening') */
component: string;
/** Opaque per-mount correlation ID (format `sess_<12 hex chars>`) — NOT the
* same value as IframeInstance.id / the mounted/unmounted `instanceId`. Use
* it only to correlate component_* events from the same mount() call. */
sessionId: string;
/** ISO 8601 timestamp */
timestamp: string;
}
interface ComponentReadyPayload {
component: string;
sessionId: string;
timestamp: string;
/** Time from component_loaded to component_ready, in ms */
loadTimeMs: number;
}
interface ComponentErrorPayload {
component: string;
sessionId: string;
timestamp: string;
errorCode: string;
errorMessage: string;
}
interface ComponentDestroyedPayload {
component: string;
sessionId: string;
timestamp: string;
/** Total time the component was alive, in ms */
durationMs: number;
}
Next Steps
- SDK Methods — method signatures, options, and callback detail
- Lifecycle Events — event order and usage patterns
- Screening Pre-fill — per-field prefill formats