Step-by-step guide to install the TakeProfit Widget SDK, covering prerequisites, installation commands, and initial setup. Follow this guide to ensure the SDK is correctly integrated into your project and ready for widget development on the TakeProfit platform.
Prerequisites
package.json
file. If not, you can create one with:
Install the SDK
yarn
, you can install it with:package.json
file and download it to the node_modules
directory.takeprofit-widget-sdk
listed under "dependencies"
in your package.json
file, like this:^0.2.3
with the version number you have installed.Initialize the SDK in Your Project
index.js
, app.js
, or main.ts
) and import the SDK:
connect
method when your widget is ready to communicate with the platform:
hideLoader
function after initialization:
Verify Installation
npm start
or yarn start
).takeprofit-widget-sdk
.<your iframe URL>
and <icon URL>
with the actual URLs for testing.
Cannot find module 'takeprofit-widget-sdk'
npm install
again to confirm all dependencies are correctly installed.Error: Version compatibility with Node.js
node -v
. Update if necessary.Widget Doesn’t Load in TakeProfit Platform
iframeUrl
in the local storage configuration points to a
live or local server. - Clear the browser cache and try reloading the page.