hf-passport

hf-passport

Usage no npm install needed!

<script type="module">
  import hfPassport from 'https://cdn.skypack.dev/hf-passport';
</script>

README

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

Property Type Default Description
iframeUrl string The url of iframe
passportUrl string The baseUrl of passport
iframeWidth string '400px' The width of iframe
iframeheight string '500px' The height of iframe
onSuccess Function Callback 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