Catalog npm
PACKAGE EXPLORERView in registry

5paisa-tradingview-webhook

npm

A React component for integrating TradingView webhooks with trading platforms. This component provides a user interface for generating webhook URLs and JSON payloads that can be used to connect TradingView alerts with trading accounts.

Versions collected20
Direct dependencies84From release 0.0.20
Last observed20 Oct, 20:38 UTC

README

Current package documentation

React Webhook Integration Component

A React component for integrating TradingView webhooks with trading platforms. This component provides a user interface for generating webhook URLs and JSON payloads that can be used to connect TradingView alerts with trading accounts.

Features

  • Generate and manage webhook URLs with configurable expiry periods
  • Create custom order JSON payloads
  • Support for both custom orders and basket orders
  • Real-time URL and JSON copying functionality
  • Built-in validation and error handling
  • Responsive design with mobile support
  • Integration with trading platforms

Installation

npm install trading-webhook-component

Dependencies

This component requires the following peer dependencies:

{
  "react": "^17.0.0 || ^18.0.0",
  "react-dom": "^17.0.0 || ^18.0.0",
  "moment": "^2.29.0",
  "react-outside-click-handler": "^1.3.0"
}

Usage

import { Webhook } from 'trading-webhook-component';

function App() {
  return (
    <Webhook 
      closeWebHookModal={() => {}} 
      platform="5PTRADE"
      style={{ width: '800px' }} 
    />
  );
}

Props

PropTypeRequiredDescription
closeWebHookModalfunctionNoCallback function to close the webhook modal
styleCSSPropertiesNoCustom styles to apply to the component
platform"5PTRADE" | "Derivative360"YesTrading platform identifier

Component Structure

The component consists of three main sections:

  1. URL Generation

    • Generate webhook URLs with customizable validity periods
    • Copy URL functionality
    • URL expiry tracking
  2. JSON Object Generation

    • Custom order configuration
    • Basket order selection
    • Order type selection (Market/Limit)
    • Transaction type selection (Buy/Sell)
    • Product type selection (Delivery/Intraday)
  3. Educational Resources

    • Links to documentation
    • Video tutorials
    • Quick start guides

API Integration

The component expects the following API endpoints to be available:

getWebHookDetails(clientCode: string): Promise<WebHookResponse>
getWebHookToken(validity: number, clientCode: string): Promise<TokenResponse>
getBaskets(clientCode: string): Promise<BasketResponse>

Types

type WebhookProps = {
  closeWebHookModal?: () => void;
  style?: CSSProperties;
  platform: "5PTRADE" | "Derivative360";
};

type OrderDataType = {
  RequestType: string;
  PlaceOrderReqList: SingleOrderDataType[] | BasketOrderType[];
};

type SingleOrderDataType = {
  transactionType: string;
  orderType: string;
  quantity: number;
  price: string;
  exchange: string;
  Symbol: string;
  productType: string;
};

Styling

The component uses SCSS modules for styling. You can override the default styles by providing your own style:

style={{ height: "800px" }}

Error Handling

The component includes built-in error handling for:

  • Failed API requests
  • Invalid URL generation
  • Basket loading errors
  • Invalid order parameters

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 20

Collected releases
VersionPublishedDirect dependenciesOpen version
0.0.20Registry latest11 Sept 202584
0.0.1911 Sept 202589
0.0.1811 Sept 202589
0.0.1711 Sept 202589
0.0.1611 Sept 202589
0.0.1511 Sept 202589
0.0.1411 Sept 202589
0.0.1311 Sept 202589
0.0.1211 Sept 202589
0.0.1111 Sept 202589
0.0.1011 Sept 202589
0.0.911 Sept 202589
0.0.811 Sept 202589
0.0.711 Sept 202589
0.0.611 Sept 202589
0.0.511 Sept 202589
0.0.410 Sept 202589
0.0.310 Sept 202589
0.0.210 Sept 2025134
0.0.110 Sept 2025134

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1e76e95e1911467a6de3afc2743786421d3dee333fe8b0327256badc6498f41e