Skip to main content
Truv Bridge emits client-side events during the user’s connection flow. These are JavaScript callbacks configured when you initialize TruvBridge.init(). They are distinct from server-side webhook events.
  • Callbacks: Responses for specific Truv Bridge actions
  • Event data: onEvent types and their payload shapes
  • Errors: Bridge error objects, types, and codes

Callbacks

const bridge = TruvBridge.init({
  bridgeToken: bridgeToken,
  onSuccess(publicToken, metadata) {},  // required
  onLoad() {},                          // optional
  onEvent(type, payload) {},            // optional
  onClose() {},                         // optional
})
CallbackRequiredDescription
onSuccessRequiredUser successfully connected to a payroll provider and closed Bridge. Receives publicToken and a metadata object.
onLoadOptionalTruv Bridge finished loading.
onEventOptionalA specific event occurred within Bridge. See Event data for all types.
onCloseOptionalTruv Bridge was closed by the user.
The Embedded Orders flow uses a different callback signature. See Embedded Orders for the correct initialization pattern when using isOrder: true.

Event data

onEvent Types

Event TypePayloadDescription
LOADNoneBridge module finished loading
OPENCommonEventDataBridge is ready and visible
SCREEN_VIEWScreenViewDataA Bridge screen was viewed
EMPLOYER_SELECTEDEmployerSelectedDataEmployer or provider selected
DOC_UPLOAD_OPENEDCommonEventDataDocument upload screen opened
DOCUMENTS_UPLOADEDDocumentsUploadedDataSpecific document types uploaded
LINK_CREATEDTaskDataUser logging in as a new Link
LOGIN_COMPLETETaskDataUser successfully logged in
SUCCESSTaskDataData successfully retrieved
ERRORErrorDataError during connection process
UNSUPPORTED_BROWSERNoneBrowser is not supported
CLOSECloseDataBridge was closed
MANUAL_DDSManualDDSDataManual Direct Deposit Switch (DDS) operation submitted
OAUTH_OPENEDOAuthEventDataUser redirected to OAuth login (assets/transactions only)

CommonEventData

Present on OPEN and DOC_UPLOAD_OPENED events.
FieldTypeDescription
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type (income, employment, assets, etc.). May be undefined if token is expired.
data_sourcestringUnderlying data source: payroll, docs, financial_accounts, tax, or insurance
{
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "data_source": "payroll"
}

ScreenViewData

FieldTypeDescription
view_namestringScreen viewed: SELECT_EMPLOYER, PROVIDER_LIST, PROVIDER_LOGIN, PROVIDER_ORG_ID, ERROR, SUCCESS, DOC_UPLOAD, DOC_UPLOAD_TYPES
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
doc_typestringApplicable only for DOC_UPLOAD: paystub, w2, or f1099
data_sourcestringUnderlying data source: payroll, docs, financial_accounts, tax, scoring_attributes, or insurance
{
  "view_name": "PROVIDER_LOGIN",
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "data_source": "payroll"
}

EmployerSelectedData

FieldTypeDescription
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
employerobjectEmployer object with name property. null if none selected.
providerstringID of the selected provider. null if none selected.
data_sourcestringUnderlying data source
{
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "employer": { "name": "Acme Corp" },
  "provider": "workday",
  "data_source": "payroll"
}

DocumentsUploadedData

FieldTypeDescription
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
doc_typestringType of document uploaded: paystub, w2, or f1099
data_sourcestringAlways docs for document upload events
{
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "doc_type": "paystub",
  "data_source": "docs"
}

TaskData

Present on LINK_CREATED, LOGIN_COMPLETE, and SUCCESS events.
FieldTypeDescription
public_tokenstringExchange for access_token on your server
task_idstringUnique task identifier. Include in support tickets.
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
employerobjectEmployer data object. May be undefined for admin product type.
provider_idstringUnique identifier for the selected provider
data_sourcestringUnderlying data source
{
  "public_token": "d80ec8255dc54c5eb7cc03ac05d18ebd",
  "task_id": "2b0e7a7dec1d47678fec4e02af621cc0",
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "provider_id": "adp",
  "employer": { "name": "Acme Corp" },
  "data_source": "payroll"
}

ErrorData

FieldTypeDescription
errorobjectError object. See Errors.
public_tokenstringAssociated public_token. Only present if error is tied to a specific connection attempt.
task_idstringTask identifier. Include in support tickets.
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
data_sourcestringUnderlying data source
{
  "error": {
    "error_code": "LOGIN_ERROR",
    "error_message": "Username or password is incorrect",
    "error_type": "LINK_ERROR"
  },
  "task_id": "5ad1938450c54024bbc967a3a7dc9020",
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "income",
  "data_source": "payroll"
}

CloseData

FieldTypeDescription
employerobjectEmployer selected before closing. undefined if no employer was chosen.
{
  "employer": { "name": "Acme Corp" }
}

ManualDDSData

FieldTypeDescription
actionstringOperation type: EMAIL, DOWNLOAD, SHARE, or EXTERNAL_FLOW
depositTypestringDeposit type selected: entire, percent, or amount. Not present for EXTERNAL_FLOW.
{
  "depositType": "entire",
  "action": "EMAIL"
}

OAuthEventData

FieldTypeDescription
bridge_tokenstringThe bridge_token passed to TruvBridge.init
product_typestringProduct type
task_idstringTask identifier
provider_idstringUnique identifier for the selected provider
urlstringOAuth URL the user is redirected to
{
  "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
  "product_type": "assets",
  "provider_id": "truv_bank_oauth",
  "task_id": "5ad1938450c54024bbc967a3a7dc9020",
  "url": "https://www.truv.com/oauth-login.html?..."
}

Errors

{
  "error": {
    "error_code": "LOGIN_ERROR",
    "error_message": "Username or password is incorrect",
    "error_type": "LINK_ERROR"
  }
}
Design your UX to surface login errors to borrowers in real time. When onEvent fires with type ERROR and error_code: LOGIN_ERROR, prompt the user to re-enter their credentials rather than silently failing.

Error Object

FieldTypeDescription
error_typestringCategory of error
error_codestringSpecific error code
error_messagestringHuman-readable description

Error Types

TypeDescription
LINK_ERRORGeneric link-level error

Error Codes

CodeDescription
ERRORGeneric error occurred
LINK_EXISTSUser’s account is already connected
LOGIN_ERRORIncorrect username, password, or both
MFA_ERRORInvalid MFA input
NO_DATAUser account has no data available
UNAVAILABLEPayroll provider is unreachable

Route errors to manual fallback

When Bridge encounters an error, intercept it client-side and route the user to a manual verification workflow instead of dead-ending the experience.
  1. Detect the error. Register an onEvent callback when initializing Truv Bridge. When onEvent fires with type ERROR, inspect the error_code in the payload.
  2. Close Bridge. After capturing the error details, close the Bridge widget programmatically or wait for the user to close it via onClose.
  3. Route to fallback. Based on the error type, redirect the user to your manual process — document upload, paper form submission, or a support contact flow.
error_codeMeaningRecommended fallback
LOGIN_ERRORIncorrect credentialsPrompt the user to retry. After repeated failures, offer document upload.
MFA_ERRORInvalid MFA inputPrompt the user to retry. After repeated failures, offer document upload.
UNAVAILABLEPayroll provider is unreachableRoute directly to document upload or manual process. The provider outage is not user-fixable.
NO_DATAAccount has no dataRoute to document upload. The connected account lacks the required records.
ERRORGeneric errorLog the task_id for debugging. Offer document upload as a fallback.
Track which error_code values trigger manual fallbacks in your analytics. A high rate of UNAVAILABLE errors for a specific provider may indicate a temporary outage, while frequent LOGIN_ERROR events may point to a UX issue in your credential entry flow.
Bridge errors are client-side events, distinct from server-side webhook events and task status changes. Use both in combination: Bridge onEvent for real-time UX routing, and webhooks for backend workflow orchestration.

Next steps

SDKs & Libraries

Install Truv Bridge for web and mobile

Task Events

Server-side event reference for task and data-object events

Connection Lifecycle

Task status flow referenced by Bridge events

Deeplinking

Skip employer search to improve conversion