Use the Site Reputation SDK
Querying Site Reputation
The Site Reputation SDK enables you to warn or guard your users from accessing low reputation websites. The getSiteReputation
function of the SDK returns a SiteReputation
structure with attributes you can use to form a decision on whether to block access to a site or display a warning to your users.
// const client = new SudoSiteReputationClient({...})
import {
SiteReputation
} from '@sudoplatform/sudo-site-reputation'
let siteReputation: SiteReputation
try {
siteReputation = client.getSiteReputation('https://sudoplatform.com')
console.log(siteReputation.reputationStatus)
} catch (error) {
// implement error handling
}
SiteReputation Interface
/**
* The state of knowledge of a site's reputation.
*/
export type ReputationStatus = 'NOTMALICIOUS' | 'MALICIOUS' | 'UNKNOWN'
/**
* The response of a given url's site reputation.
*/
export interface SiteReputation {
/** Returns `MALICIOUS` if malicious, `NOTMALICIOUS` if not, and `UNKNOWN` if unable to be determined. */
reputationStatus: ReputationStatus
}
Last updated