Socket
Socket
Sign inDemoInstall

blockmate-react-link

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    blockmate-react-link

Application to link external service to Blockmate Link app


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Install size
13.4 kB
Created
Weekly downloads
 

Readme

Source

Application to link external service to Blockmate Link app

JavaScript Style Guide

Install

Run npm i blockmate-react-link

JWT Token

Application requires correct jwt token in order to be used.

  1. Get a User JWT token by Authentication of End-user from https://docs.blockmate.io/docs/quickstart

  2. In your Link component you can get a linkToken using user_jwt_token from the previous point.

Usage


import React, { useState, useEffect } from "react";
import axios from "axios";
import { handleClose, handleOpen, LinkModal } from 'blockmate-react-link'

const YourConnectComponent = ({user_jwt_token}) => {
    const [linkToken, setLinkToken] = useState(null);

 
    useEffect(() => {
        axios.post(
            "/v1/link/link/token",
            {
                "jwt": user_jwt_token,
                "redirect_uri": ""
            },
            {
                baseURL: "https://link.blockmate.io"
            }
        ).catch(e => {
            console.log(e)
        }).then(r => {
            setLinkToken(r.data.link_token)
        })
    }, [user_jwt_token])

 

    return (
      <>
        <LinkModal url="https://link.blockmate.io" jwt={linkToken} />
        <div>Test APP</div>
        <button onClick={handleOpen}>Open</button>
      </>
    )
}

 
export default YourConnectComponent

License

MIT © blockmate-io

Keywords

FAQs

Last updated on 12 Jan 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc