1.0.13 • Published 2 years ago

oneid-sdk v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

OneID SDK for JavaScript

NPM

For more information on OneID and its features, see the documentation.

🚀 Getting Started

The easiest way to integrate the OneID SDK into your JavaScript project is through the npm module. However, if you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/browse/oneid-sdk@1.0.13/src/index.ts.

📲 Installation

You can easily install this package from NPM by running the following command in your terrminal:

$ npm install --save oneid-sdk

Or including the script in your HTML file via UNPKG:

<script src="https://unpkg.com/browse/oneid-sdk@1.0.13/src/index.ts"></script>

To use the npm modules for a browser based application, include it as you normally would:

// ES5 with module loaders/bundlers 
const OneId = require('oneid-sdk');
// ES6 with module loaders/bundlers
import OneId from 'oneid-sdk'

🎁Features

The OneID JavaScript SDK currently offers the following features:

💻 Usage

OneId.start(options)

The initialization of OneId comes first. This is done at the highest level of your application to guarantee that the OneId SDk's global instance executes correctly. To get the SDK started, use the start() method as follows:

Example code:

const options = {
    apiKey: "YOUR_API_KEY",
    siteDomain: "YOUR_SITE_DOMAIN starting with http:// or https://"
}
window.addEventListener('load', () => {
    OneId.start(options)
}
optionsDescription
apiKeyThis is a private key assigned to each developer's account. Generate one here.
siteDomainThis a url of the same-origin with your application starting with http:// or https://

OneId.handleAuth(options)

Using the SDK for user authentication is really simple. When you call the handleAuth() method, a window will pop up which processes the authentication and then returns you to the application.

Example code:

btn.addEventListener('click', (e) => {
    e.preventDefault()

    OneId.handleAuth().then((data) => {
        console.log(data);
    }).catch(error => {
        console.log(error);
    })
})

🤝Support

If you have any problems when using this SDK, please file a bug report on this repository by creating an issue and the development team will look into it as soon as possible.

⌨ Typescript

This library offers first-class Typescript support.

✔ License

MIT © wolzcodelife.web.app . GitHub @wolz-codelife

1.0.13

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.2

2 years ago

1.0.3-ion

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago