New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ruptjs/core

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ruptjs/core

Core library operates as a convenient wrapper for all Rupt API methods.

  • 0.0.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Rupt SDK (core)

The Rupt Core SDK is designed to be used on the server. It operates as a convenient wrapper for all Rupt API methods and benefits from type safety and intellisense.

Installation

yarn add @ruptjs/core

or if using npm

npm install @ruptjs/core

Import and instantiation

Replace API_SECRET with your Rupt API secret key. This can be found in your Rupt dashboard. Select the secret key for the api key you want to use.

import RuptCore from '@ruptjs/core';
const Rupt = new RuptCore(API_SECRET);

Usage

List all challenges

Returns a list of your challenges. The challenges are returned sorted by creation date, with the most recently created challenges appearing first.

const { data, total } = await Rupt.getChallenges({
  page: 1,
  limit: 10,
});

Retrieve a challenge

Retrieve the details of an existing challenge. Supply the unique challenge ID from the Rupt SDK onChallenge callback.

const { challenge } = await Rupt.getChallenge(CHALLENGE_ID);

Retrieve challenge devices

Retrieve the list of devices for an existing challenge.

const { data } = await Rupt.getChallengeDevices(CHALLENGE_ID);

Kick a challenge device

Kick an attached device for an existing challenge. Supply the unique challenge ID from the Rupt SDK onChallenge callback. Supply the unique device ID from the list of devices for the challenge.

await Rupt.kickChallengeDevice({
  challenge: "CHALLENGE_ID",
  device: "DEVICE_ID",
});

Send challenge code

Send a two-factor authentication code for an existing challenge.

await Rupt.sendChallengeCode({
  challenge: "CHALLENGE_ID",
  device: "DEVICE_ID",
  language: "en",
  channel: "email"
});

Verify challenge code

Verify a device for an existing challenge.

await Rupt.verifyChallengeCode({
  challenge: "CHALLENGE_ID",
  code: "123456"
});

Complete challenge

Complete an existing challenge.

const { challenge } = await Rupt.completeChallenge(CHALLENGE_ID);

Evaluate an action

Evaluate an action for a user.

const { verdict, reasons, challenge_id } = await Rupt.evaluate({
  action: "login",
  user: "USER_ID",
  fingerprint: ["FINGERPRINT_ID", "LAST_FINGERPRINT_ID"], // Use the rupt client sdk method `getHash` to get the fingerprint hashes from the browser
  ip: "IP_ADDRESS",
});

To learn more, visit the api documentation

Keywords

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc