1⃣
Install SDK
Easy and simple to install
Our SDK supports installation through several sources, which include CDN and direct installation through NPM.

Install with CDN

To install via CDN, simply insert a link to the js bundle with our SDK.
<script src="https://unpkg.com/[email protected]/dist/rubic-sdk.min.js"></script>

Install with NPM and webpack

To install via NPM, just run one command in the console, but if your project does not contain web3, additional steps are required
npm install rubic-sdk
ℹ️️ Skip the rest of the steps if your have already installed web3 in your project.
  • npm install --save-dev http-browserify https-browserify stream-browserify crypto-browserify
  • modify webpack.config.js. If you use create-react-app, run npm run eject to extract config
    1. 1.
      add to plugins
      new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'], process: 'process/browser'})
    2. 2.
      add resolve.fallback
      "fallback": { "fs": false, "constants": false, "querystring": false, "url": false, "path": false, "os": false, "http": require.resolve("http-browserify"), "https": require.resolve("https-browserify"), "zlib": false, "stream": require.resolve("stream-browserify"), "crypto": require.resolve("crypto-browserify")}

Installation with npm for Angular

Installing the package from the NPM for Angular is similar, but in case your project does not contain web3, the additional steps will be different.
  • npm install rubic-sdk
ℹ️️ Skip the rest of the steps if your have already installed web3 in your project.
  • npm install --save-dev stream-browserify assert https-browserify os-browserify stream-http crypto-browserify process buffer
  • Modify tsconfig.json
    {
    "compilerOptions": {
    ...
    "paths": {
    ...
    "stream": ["./node_modules/stream-browserify"],
    "assert": ["./node_modules/assert"],
    "https": ["./node_modules/https-browserify"],
    "os": ["./node_modules/os-browserify"],
    "http": ["./node_modules/stream-http"],
    "crypto": ["./node_modules/crypto-browserify"]
    }
    }
  • Modify polyfills.ts
    import Process = NodeJS.Process;
    export interface AppWindow extends Window {
    process: Process;
    Buffer: Buffer;
    }
    (window as AppWindow).process = window.process || require('process');
    (window as AppWindow).Buffer = (window as any).Buffer || require('buffer').Buffer;
Copy link