open-index/open-npm huggingface dataset:
npm package: @hyprjs/hypr-fido2-sdk
Description: HYPR SDK for FIDO2 Browser
Author: HYPR Corp
Latest version: 0.3.1

# HYPR SDK for FIDO2 Browser

A small, no-dependencies SDK that provides utility functions to assist in interacting with the JavaScript [WebAuthn API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API).

## Requirements
You will need a relying party server to handle registering and authenticating a user via the SDK. For assistance with this, [contact](https://www.hypr.com/contact) the HYPR Sales team.

## Installation

#### ECMAScript module
```
npm install @hyprjs/hypr-fido2-sdk
```

```javascript
import HYPRFido2Client from "@hyprjs/hypr-fido2-sdk";
```

#### Script Tag (jsDelivr CDN)
```javascript
<script src="https://cdn.jsdelivr.net/npm/@hyprjs/hypr-fido2-sdk/dist/hyprfido2sdk.min.js"></script>
```

#### Script Tag (unpkg CDN)
```javascript
<script src="https://unpkg.com/@hyprjs/hypr-fido2-sdk/dist/hyprfido2sdk.min.js"></script>
```

## Usage

#### Register a User 
```javascript
// Create attestation options
const options = HYPRFido2Client.createAttestationOptions(...)

// Process options with RP server and get result
const result = fetch("/rp/server/url", { method: "POST", body: JSON.stringify(options) })

// Create credentials
HYPRFido2Client.createFido2Credential(result, () => {})
```

#### Authenticate a User
```javascript
// Create assertion options
const options = HYPRFido2Client.createAssertionOptions(...)

// Process options with RP server and get result
const result = fetch("/rp/server/url", { method: "POST", body: JSON.stringify(options) })

// Use credentials
HYPRFido2Client.useFido2Credential(result, () => {})
```


## Documentation
See [HYPR SDK for FIDO2 Browser](https://docs.hypr.com/docs/sdk/sdkFIDO2WebAuthn/sdk-fido2-webauthn-browser)