1.2.4 • Published 5 years ago

oneaccount-react v1.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Installing

npm install oneaccount-react

Quickstart

Import oneaccount-react library in your app.

import OneAccount from 'oneaccount-react'

Usage

<OneAccount
  externalId="{here comes your application id}"
  updateInterval={3 * 60 * 1000} // specify time you want qrcode to update in ms
  floatingMode // use of floatingMode is recommended, use default mode only when you need full customizations
  icons
  title
  authText
  onUpdate={uuid => {
    console.log(uuid) // use this uuid to confirm authentication
  }}
/>

Options

externalId (string, required)

This field is generated automatically when the app is created (please don't change)

color (string) = '#3C444F'

Defines the color of whole library elements

floatingMode (boolean or element) = false

Enables floating mode (disable if you want to customize the library) Please do not use logo element since this functionality might be removed

updateInterval (number, ms) = 3 60 1000

Interval to update the qr-code

title (string, element or boolean) = 'Download One account mobile app and scan the qr code or click the QR code if One account is installed on current device'

Title describes usage of the application. Set to false to remove title or to true to show default title or replace it with any text or element you want.

authText (string, element or boolean)

Text next to floating logo Set to false to remove authText or to true to show default authText or replace it with any text or element you want.

icons (boolean or element)

Icons with links to download the application.

onUpdate (uuid: string)

Fires on every qr-code update and emits new uuid

NOTE: authText, icons and title are only shown when floatingMode is enabled


Another note: there are more props that provide more control over the element, however, they should not be used since the may be removed at any point.

Here are all the props that should be used:

OneAccount.propTypes = {
  externalId: PropTypes.string.isRequired,
  updateInterval: PropTypes.number,
  color: PropTypes.string,
  floatingMode: PropTypes.oneOfType([
    PropTypes.shape({
      logo: PropTypes.element
    }),
    PropTypes.bool
  ]),
  title: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.element,
    PropTypes.bool
  ]),
  authText: PropTypes.oneOfType([
    PropTypes.string,
    PropTypes.element,
    PropTypes.bool
  ]),
  icons: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
  onUpdate: PropTypes.func
}
1.2.4

5 years ago

1.2.3

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.21

5 years ago

1.1.20

5 years ago

1.1.19

5 years ago

1.1.18

5 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.102

5 years ago

1.0.101

5 years ago

1.0.100

5 years ago

1.0.98

6 years ago

1.0.97

6 years ago

1.0.96

6 years ago

1.0.95

6 years ago

1.0.94

6 years ago

1.0.93

6 years ago

1.0.92

6 years ago

1.0.91

6 years ago

1.0.90

6 years ago

1.0.89

6 years ago

1.0.88

6 years ago

1.0.87

6 years ago

1.0.86

6 years ago

1.0.85

6 years ago

1.0.84

6 years ago

1.0.83

6 years ago

1.0.82

6 years ago

1.0.81

6 years ago

1.0.79

6 years ago

1.0.78

6 years ago

1.0.77

6 years ago

1.0.76

6 years ago

1.0.74

6 years ago

1.0.73

6 years ago

1.0.72

6 years ago

1.0.71

6 years ago

1.0.70

6 years ago

1.0.69

6 years ago

1.0.67

6 years ago

1.0.66

6 years ago

1.0.65

6 years ago

1.0.64

6 years ago

1.0.63

6 years ago

1.0.62

6 years ago

1.0.61

6 years ago

1.0.60

6 years ago

1.0.59

6 years ago

1.0.58

6 years ago

1.0.57

6 years ago

1.0.56

6 years ago

1.0.55

6 years ago

1.0.54

6 years ago

1.0.53

6 years ago

1.0.52

6 years ago

1.0.51

6 years ago

1.0.50

6 years ago

1.0.49

6 years ago

1.0.48

6 years ago

1.0.47

6 years ago

1.0.46

6 years ago

1.0.45

6 years ago

1.0.44

6 years ago

1.0.43

6 years ago

1.0.42

6 years ago

1.0.41

6 years ago

1.0.40

6 years ago

1.0.39

6 years ago

1.0.38

6 years ago

1.0.37

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago