npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@levelcredit/js-react-levelcredit

v2.1.26

Published

LevelCredit React Library

Downloads

10

Readme

LevelCredit ReactJS Component Library

This ReactJS component library will allow a partner to display the TransUnion Vantage 2.0 Credit Score from LevelCredit with the user's browser while maintaining security and compliance with TransUnion's policies. Example of what this will return:

GitHub Repositories

Getting Started

Install as dependency using npm install command

npm install --save @levelcredit/js-react-levelcredit

To start using either the components like <ScoreChart /> or react hook like useScore(), you will need to wrap around the part that is being used with a provider (<LevelCreditProvider />). The LevelCredit provider will help expose which api endpoint the react library will use.

Example

export default function App() {
    const credit_display_token = ...; // Backend to get the display token from CreditAPI

    return (
        <LevelCreditProvider env="production">
            <ScoreDisplay display_token={credit_display_token} />
            <ScoreChart display_token={credit_display_token} />
            <CustomHookComponent />
        </LevelCreditProvider>
    );
}

function CustomHookComponent() {
    const credit_display_token = ...; // Backend to get the display token from CreditAPI
    const [scores] = useScore(credit_display_token);
}

Dependencies

To use this component, there are some required dependencies. The following dependencies are required with their minimum supported versions written next to it:
[email protected], [email protected], [email protected]

API

Provider

<LevelCreditProvider />

import { LevelCreditProvider } from "@levelcredit/js-react-levelcredit";

| Props | Type | Default | | -------------- | ------------------------------------------------------------------------------------- | -------- | | env (REQUIRED) | "development" \| "staging" \| "production" | NULL | | base_url | string | NULL | | auth_token | string | NULL | | auth_type | APIAuthType | none |

When setting APIAuthType, please note that we have 2 ways to authenticate through the header. Setting "header" defaults to using "header-authorization"

# header-authorization
Authorization: Bearer <access_token>

# header-sid
SID: <jwt>

CreditAPI


ObligationAPI

useObligationTradeline(): FetchObligationTradeline

import { useObligationTradeline } from "@levelcredit/js-react-levelcredit";
type FetchObligationTradeline = (
  obligation: ObligationType, // ObligationType: "contracts" | "leases" | "utilities"
  obligation_id: number
) => Promise<ObligationTradelineObject>;

type ObligationTradelineObject = {
  [key: string]: TradelineStatusObject; // ["YYYY-DD"]: TradelineStatusObject,
};

type TradelineStatusObject = { status: TradelineStatus };

TradelineStatus types

<TradelineHistory />

import { TradelineHistory } from "@levelcredit/js-react-levelcredit";

| Props | Type | Default | | ------------- | ---------------------------------------- | -------- | | obligation | "contracts" \| "leases" \| "utilities" | NULL | | obligation_id | number | NULL | | classes | JSS Classes | {} |

JSS Classes TradelineHistory, TableHead, TableColumnHead, TableBody, TableColumnYear, TableColumn, POSITIVE_REPORT, POSITIVE_LOOKBACK_REPORT, POSITIVE_LOOKBACK_AVAILABLE, PENDING_REPORT_HOLD, PENDING_REPORT, NEGATIVE_LATE_30, NEGATIVE_LATE_60, NEGATIVE_LATE_90, NEGATIVE_LATE_120, NEGATIVE_LATE_150, NEGATIVE_LATE_180, NO_PAYMENT


ProtectionAPI

useMonitoring(): [null | MonitoringObject, FetchMonitoring]

import { useMonitoring } from "@levelcredit/js-react-levelcredit";
interface MonitoringObject {
  enabled: boolean;
  status: string;
  new_alerts_count: number;
}

type FetchMonitoring = () => Promise<null | MonitoringObject>;

useMonitoringAlerts(): [null | AlertSimple[], FetchMonitoringAlerts, DismissMonitoringAlert]

import { useMonitoringAlerts } from "@levelcredit/js-react-levelcredit";
interface AlertSimple {
  id: number;
  url: string;
  alert_type: string;
  bureau: string;
  created_at: string;
  dismissed_at: string;
}

interface AlertDetailed extends AlertSimple {
  product_display_id: string;
}

type FetchMonitoringAlerts = () => Promise<AlertSimple[]> | (alert_id: number) => Promise<AlertDetailed>;

type DismissMonitoringAlert = (alert_id: number) => Promise<void>;

<MonitoringAlert />

import { MonitoringAlert } from "@levelcredit/js-react-levelcredit";

| Props | Type | Default | | ------------------------ | ------------- | ------- | | allow_dismissed_alerts | boolean | true | | show_dismissed_alerts | boolean | false | | show_view_history_button | boolean | true | | classes | JSS Classes | {} |

JSS Classes MonitoringAlert, MonitoringAlertList, AlertMonitoringDismissed, MonitoringAlertButton, Alert, AlertInfo, AlertInfoDetails, AlertInfoType, AlertInfoDate, AlertInfoDismiss, AlertInfoOpen, AlertInfoOpenIcon, AlertInfoOpenIconOpened, AlertDetails, AlertDetailsEnter, AlertDetailsEnterActive, AlertDetailsExit, AlertDetailsExitActive, AlertData, AlertDataHasChildren, AlertDataTitle, AlertDataDescription, AlertDataChildren, AlertLoading