npm package: @loginid/sdk
Description: LoginID Web SDK
Author: LoginID
Latest version: 0.13.2

# LoginID - Web SDK

## Description

Add FIDO hardware based biometric authentication to your website or app in 3 easy steps:
* [View our documentation](https://docs.loginid.io/Client-SDKs/Web/web-get-started?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)
* [Sign up on the dashboard](https://usw1.loginid.io/en/register/get-started?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)
* [View our tutorial](https://tutorial.loginid.io/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)

The LoginID Web SDK enables you to add FIDO2 certified multi-factor authentication to your web-based application all the while having full control over the user experience with no redirection to pages outside your application. LoginID leverages the biometrics or however the device is unlocked (e.g. PIN for Windows Hello) on the end user's device to create a seamless process for secure passwordless authentication. Additionally, LoginID offers [Transaction Confirmation](https://docs.loginid.io/Guides/Flows/tx-conf-guide?utm_source=npmjs&utm_medium=package&utm_campaign=downloads), where a transaction can be cryptographically signed providing proof of the user’s confirmation of that specific transaction, which is perfect for merchants who want payment authentication services as well. LoginID is aligned withPSD2, GDPR, CCPA, and HIPPA.

For more robust functionality, it is recommended that you also leverage a [Server SDK](https://www.npmjs.com/package/@loginid/node-sdk?utm_source=npmjs&utm_medium=package&utm_campaign=downloads). If your backend is written in something other than Node, check out our [documentation](http://docs.loginid.io/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads) for other options. The Server SDK makes requests to LoginID's API easier by leveraging an API Credential to perform sensitive operations, such as adding managing authenticators. Check out the LoginID Server SDK for a simplified integration.

### NPM:
```js
import WebSDK from '@loginid/sdk';
const sdk = new WebSDK("BASE_URL", "CLIENT_ID");
```

### HTML:
```HTML
<!-- Import module from the JS SDK -->
<script src="./src/vendor/loginid.web.min.js"></script>
<script>
    const sdk = new LoginID.web.default(
        "BASE_URL", "CLIENT_ID"
    );
    // ...
</script>
```

To complete an end-to-end FIDO experience for your user, we strongly recommend enabling the following flows in your application.

**NOTE:** To use LoginID endpoints needed for the below flows, you will either need to:
* Use our server SDK or 
* Call our APIs directly using your server implementation. Please note, for this option you will need to generate an [API Service Token](https://docs.loginid.io/Guides/Miscellaneous/api-service-tokens/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads).

### [Account Recovery](https://docs.loginid.io/Guides/Flows/account-recovery-guide/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)
Users regularly lose or upgrade their devices, which can be a problem in the FIDO space as the credential is tied to the device. We strongly recommend encouraging your users to register multiple devices, though there may be cases where this cannot happen.

### [Add New Authenticator](https://docs.loginid.io/Guides/Flows/add-new-authenticator-guide/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)
The majority of customers have multiple devices, and they expect to be able to access your application from all of them. In order to add this new device securely, a previously registered device is required to authorize the new device.

### [One-Time Authentication](https://docs.loginid.io/Guides/Flows/one-time-authentication-guide/?utm_source=npmjs&utm_medium=package&utm_campaign=downloads)
Some customers may want to log in on devices which either do not support FIDO, or a device which they do not own. In order to access this new device securely, a previously registered device is required to authorize the new device.

## How we’re doing
Have our solution in production? Please join our developer [community](https://loginidiocommunity.slack.com#general).