2.0.1 • Published 4 years ago

hf-passport v2.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

hf-passports

Installation

yarn add hf-passport

Example

import React from 'react'
import ReactDOM from 'react-dom'
import Login from 'hf-passport'

function Example() {
  function handleSucess(token) {
    console.log(token)
  }

  return (
    <Login
      iframeUrl={iframeUrl}
      passportUrl={passportUrl}
      iframeWidth="400px"
      iframeHeight="500px"
      onSuccess={handleSucess}
    />
  )
}

ReactDOM.render(<Example />, container)

Prop Types

PropertyTypeDefaultDescription
iframeUrlstringThe url of iframe
passportUrlstringThe baseUrl of passport
iframeWidthstring'400px'The width of iframe
iframeheightstring'500px'The height of iframe
onSuccessFunctionCallback function with token parameter after successful login

Contributing

  1. git clone git@git.hellorf.work:fe/hf-passport.git
  2. cd hf-passport && npm install && npm run build && npm start