@ruptjs/client
v3.1.0
Published
Framework agnostic device intelligence to prevent fraud and drive revenue growth
Keywords
Readme
Rupt JavaScript SDK
Device intelligence and account security for browsers. This SDK powers account-sharing detection, fake-account prevention, and account-takeover protection.
Installation
yarn add @ruptjs/clientor with npm:
npm install --save @ruptjs/clientImport & instantiate
import Rupt from "@ruptjs/client";
const rupt = new Rupt({
clientId: "your-client-id",
on_logout(event) {
// Server kicked this session — sign out locally.
window.location.href = "/login";
},
});Evaluate
The SDK has one unified entry point — rupt.evaluate — with hardcoded methods for the three canonical events and a free-string overload for custom events.
Access (every protected route)
Call on every page once the user is authenticated. Starts the kick / logout listener.
await rupt.evaluate.access({
user: "user-id",
email: "[email protected]",
});Login
await rupt.evaluate.login({
user: "user-id",
email: "[email protected]",
});Signup
await rupt.evaluate.signup({
user: "user-id",
email: "[email protected]",
});Custom events
await rupt.evaluate("checkout", {
user: "user-id",
metadata: { cart_id: "abc-123" },
});Reserved actions (access, login, signup, warm, fingerprint) cannot be used as free-string events — use the hardcoded methods instead.
Fingerprint only
Resolve a browser-stable fingerprint without going through the full evaluate flow — handy for tests and lightweight integrations.
const { fingerprint_id, confidence } = await rupt.fingerprint();