RenterCheck SDKs · v0.1.0
Connect with a few lines of code
Official libraries wrap the Partner API so you do not write HTTP calls, retries, or badge markup yourself. They are optional: everything they do is available through the REST API.
Which one do I need?
Your API key is a secret. Call RenterCheck from your server, then send only the result to the browser. The JavaScript client refuses to start in a browser, and the badge never calls the API or needs a key.
Install
npm install @rentercheck/sdkSet RENTERCHECK_API_KEY in your server environment. Use an rc_test_ key while you build: it never touches real renters, and the phone numbers 0999 000 0001 to 0005 return every verdict.
JavaScript and TypeScript
@rentercheck/sdk has no dependencies, ships its own types, and runs anywhere with fetch: Node 18+, Bun, Deno, and edge runtimes. It works with both import and require.
import { RenterCheck } from "@rentercheck/sdk"
// Reads RENTERCHECK_API_KEY from the environment. Server only.
const rentercheck = new RenterCheck()
const { booking, renter } = await rentercheck.bookings.save({
bookingId: "BK-1042", // your own id; sending it again updates the booking
renter: { fullName: "Maria Santos", phone: "0917 555 0142", email: "maria@example.com" },
status: "confirmed", // your own words work: confirmed, returned, canceled...
startsAt: "2026-11-08T09:00", // Philippine time, or ISO with an offset
endsAt: "2026-11-10T09:00",
item: { name: "Toyota Vios 2022", category: "VEHICLE_CAR" },
amount: 4500,
renterConsent: true, // the renter agreed to your terms
})
renter.verdict // "VERIFIED" | "NEW" | "CAUTION" | "FLAGGED" | "NO_DATA"
renter.badge.label // "Verified by RenterCheck"
renter.score.value // 712, or null
renter.match.warning // show to staff when not nullrentercheck.bookings.save(booking)Create or update a booking and get the renter's resultrentercheck.bookings.update(bookingId, changes)Change status, dates, or amountrentercheck.bookings.get(bookingId)Saved booking with a fresh renter resultrentercheck.bookings.import(bookings, { onBatch })Backfill any number of past bookings, 200 per callrentercheck.renters.check(renter)Check a renter before booking; saves new rentersrentercheck.renters.lookup(renter)Read-only checkrentercheck.incidents.report(report)Report an incident and open the renter's response windowrentercheck.incidents.addEvidence(id, file, { type, fileName })Attach a photo or PDFrentercheck.incidents.get(id)Follow a caserentercheck.ping()Check the key and modeYour framework
Call RenterCheck right after you save a booking, every time it is created or changes. The same call returns the verdict to store or show.
// app/api/bookings/route.ts (or call it from a Server Action after saving the booking)
import { RenterCheck, RenterCheckError } from "@rentercheck/sdk"
const rentercheck = new RenterCheck()
export async function POST(request: Request) {
const booking = await request.json()
try {
const { renter } = await rentercheck.bookings.save({ ...booking, renterConsent: true })
return Response.json({ verdict: renter.verdict, badge: renter.badge, score: renter.score.value })
} catch (error) {
if (error instanceof RenterCheckError) {
return Response.json({ error: error.message, details: error.details }, { status: error.status || 502 })
}
throw error
}
}PHP and Laravel
rentercheck/rentercheck-php needs PHP 8.1+ with curl and nothing else, so it also works in plain PHP and WordPress. In Laravel it registers itself: a RenterCheck facade, config/rentercheck.php, and the <x-rentercheck-badge> Blade component.
composer require rentercheck/rentercheck-php
php artisan vendor:publish --tag=rentercheck-config # optionalThe methods match JavaScript: $rentercheck->bookings->save(), update(), get(), import(), $rentercheck->renters->check(), lookup(), and $rentercheck->incidents->report(), addEvidence(), get(). Results are plain arrays shaped like the JSON responses.
The badge, anywhere
One look, in every stack. Add the script tag to any page, or import @rentercheck/sdk/badge in a bundled app, then use <rentercheck-badge> like any HTML element. It works in plain HTML, React, Vue, Svelte, Angular, and Blade. Hovering shows the detail; a small warning mark appears when staff should check the renter's ID.
<script src="https://www.rentercheck.ph/sdk/badge.js" defer></script>
<rentercheck-badge verdict="VERIFIED" score="712"></rentercheck-badge>
<rentercheck-badge verdict="CAUTION" theme="dark" size="sm"></rentercheck-badge>
<script>
// Or pass the whole result your server got from RenterCheck:
document.querySelector("rentercheck-badge").result = data.renter
</script>Attributes: verdict, score, theme (light or dark), size (sm or md), and optional label, detail, warning. Prefer server rendering? badgeHtml(result) in JavaScript and Badge::html($result) in PHP return the same markup with inline styles. Script URL: https://www.rentercheck.ph/sdk/badge.js.
Errors and retries
- Rate limits (
429), server errors, and network failures are retried twice with backoff, honoringRetry-After. Change it withmaxRetries(JS) ormax_retries(PHP). - Anything else throws
RenterCheckError(JS) orRenterCheckException(PHP) withstatus,code, anddetails. For422,detailslists each field and what to fix. - Saving the same
bookingIdagain updates the booking, so retrying is always safe. - For bookings that fail while RenterCheck is unreachable, keep them in a queue and send them again later. The wiring guide shows the pattern.
Other languages
Python, Go, Java, Ruby, .NET, and everything else can call the REST API directly; it is a few JSON calls with one header. You can also generate a typed client from the OpenAPI spec with OpenAPI Generator. The API docs include Python and cURL examples.