opesjs
TypeScript icon, indicating that this package has built-in type declarations

0.7.43 • Public • Published

opes.js

The OPES JavaScript SDK

Maintainability Test Coverage


Installation

npm i -S opesjs

Importing into your code

import { OPES } from 'opesjs';

OPES Connect

Use as a React Hook

  const { isConnecting, accessToken, startConnecting } = OPES.useConnect(<API KEY>)

  const onConnect = () => {
    startConnecting()
  }

  const useEffect = (() => {
    console.log("Got the Access Token", accessToken)
  }, [accessToken])

  const ConnectButton = () => {
    if (isConnecting) {
      return <h1>Connecting ... </h1>
    }

    return <a className={styles} onClick={onConnect}>
      <h1>OPES Connect &rarr;</h1>
     </a>
  }

  return <ConnectButton/>

Use as plain JS

const accessToken = await OPES.Connect.getAccessToken(<API KEY>)

Readme

Keywords

none

Package Sidebar

Install

npm i opesjs

Weekly Downloads

0

Version

0.7.43

License

MIT

Unpacked Size

142 kB

Total Files

211

Last publish

Collaborators

  • idancali
  • poprobertdaniel