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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-deriv-api-ts

v1.0.2

Published

A fork of deriv-api-ts modified for React Native compatibility.

Readme

react-native-deriv-api-ts

A typescript wrapper around Deriv API.

Installation

Yarn

yarn add react-native-deriv-api-ts

NPM

npm install react-native-deriv-api-ts

Usage

Endpoints without authentication

import { DerivAPIWrapper } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(appId);
const websiteStatus = await api.websiteStatus();

console.log(websiteStatus);

// You will have intellisense on the return types...
console.log(websiteStatus.api_call_limits.max_requests_outcome.hourly);

Endpoints with authentication

You can authenticate whenever you want by calling authorize function. When you call an endpoint that needs authentication (e.g. profitTable), it will first check if the session is already authenticated. If not, it will try to authenticate with the token that is passed either to the constructor or to the last call of authorize function. If no token is found, an error will be thrown.

import { DerivAPIWrapper } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(appId);

const authResult = await api.authorize("YOUR API TOKEN");

OR

import { DerivAPIWrapper } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(appId, "YOUR API TOKEN");

Types

@deriv/api-types package is used internally to provide support for types.

import { DerivAPIWrapper, Exception, Types as binaryTypes } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(appId, "YOUR API TOKEN");
const params: binaryTypes.ProfitTableRequest = {
   contract_type: ["CALL"],
   profit_table: 1,
};

api.profitTable(params)
   .then((profitTableResult: binaryTypes.ProfitTable) => {
      // Your code
   })
   .catch((err: Exception) => {
      console.log(`Code: ${errObj.code} Message: ${errObj.message} Details: ${JSON.stringify(errObj.getParams())}`);
   })
   // Closing the websocket connection gracefully.
   .finally(() => api.disconnect());

Error Handling

import { DerivAPIWrapper, Exception, Types } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(1234, "YOUR API TOKEN");
const params: Types.ProfitTableRequest = {
   contract_type: [],
   profit_table: 1,
};

api.profitTable(params)
   .then((profitTableResult) => {
      // Your code
   })
   .catch((err: Exception) => {
      console.log(`Code: ${errObj.code} Message: ${errObj.message} Details: ${JSON.stringify(errObj.getParams())}`);
   })
   // Closing the websocket connection gracefully.
   .finally(() => api.disconnect());

OR

import { DerivAPIWrapper, Exception, Types } from "react-native-deriv-api-ts";

const appId = 1234;
const api = new DerivAPIWrapper(1234, "YOUR API TOKEN");
const params: Types.ProfitTableRequest = {
   contract_type: [],
   profit_table: 1,
};

try {
   const profitTableResult = await api.profitTable(params);
} catch (err) {
   const errObj = err as Exception;
   console.log(`Code: ${errObj.code} Message: ${errObj.message} Details: ${JSON.stringify(errObj.getParams())}`);
} finally {
   // Closing the websocket connection gracefully.
   api.disconnect();
}