Skip to main content

Step 4: View Reports

After a consumer completes a screening, you can display their report — or a list of accessible reports — by mounting the report or reports view.

Displaying a Specific Report

Pass the report.id you stored from the onScreeningSuccess callback in Step 3:

const sdk = Intellirent.init({
publishableKey: "pk_live_eu_xxxxxxxxxxxxxxxx", // The end user's key
userContext: {
userId: "enduser_abc123",
userType: "END_USER",
},
});

await sdk.mount("#report-container", {
view: "report",
report: {
id: "550e8400-e29b-41d4-a716-446655440000", // The UUID from onScreeningSuccess
},
});

The report.id value comes from result.id in the onScreeningSuccess callback during the screening in Step 3. It is a UUID that uniquely identifies the screening report.

Displaying the Reports List

Mount the reports view to show all accessible reports for the currently authenticated user:

await sdk.mount("#container", { view: "reports" });

What appears in the list depends on the user type and publishable key — see below.

Report Visibility by User Type and Key

The reports shown are scoped by both the userType and the publishable key used to initialize the SDK:

User TypeWhat They See
CONSUMEROnly their own screenings that were created with or shared to the current pk's account
END_USERAll screenings shared by consumers with the current pk's account
TSPNo cross-account view — TSP keys do not aggregate reports across end user pk's

This means an end user initialized with pk_live_eu_alice will not see screenings submitted under pk_live_eu_bob, even if both end users belong to the same TSP account.

Authorization Requirement

The access check differs by userType:

  • CONSUMER — the userId passed at mount time must match the user who originally completed the screening. If the identifiers do not match, the request is rejected.
  • END_USER — access is not based on identity matching. The end user must be registered on the TSP account (account_users), and the consumer must have an active, non-revoked report share with that account. An end user who is registered but has no share record for a given report is rejected the same as one who isn't registered.
// This will succeed only if "consumer_xyz789" was the user who completed the screening
const sdk = Intellirent.init({
publishableKey: "pk_live_eu_xxxxxxxxxxxxxxxx",
userContext: {
userId: "consumer_xyz789", // Must match the user who completed the screening
userType: "CONSUMER",
},
});

await sdk.mount("#report-container", {
view: "report",
report: { id: "550e8400-e29b-41d4-a716-446655440000" },
});

Always derive userId from a server-validated session token — never from client-provided input. See Best Practices for full guidance.

Balance Errors (Prepaid Accounts)

If your account is on the prepaid credit billing model and its credit balance is exhausted, mounting the report view for a specific report delivers an error with code: "PAYMENT_REQUIRED" and recoverable: false to your onError callback instead of rendering the report. The reports list view is not affected. Do not retry — the request will succeed again automatically once credits are added. See the Billing guide for the full error contract and recommended handling.

Next Steps

  • SDK Methods — Full reference for init, mount, and all callbacks
  • Lifecycle Events — Track mount/unmount and other lifecycle events
  • Screening Pre-fill — Pre-populate screening forms with known applicant data
  • Billing — Prepaid credit model and balance error handling
  • Type Reference — TypeScript declarations for every public SDK type