https://github.com/mohitkyadav/yubico-js
An implementation of the Yubico Validation Protocol.
https://github.com/mohitkyadav/yubico-js
yubico yubico-otp yubikey
Last synced: 15 days ago
JSON representation
An implementation of the Yubico Validation Protocol.
- Host: GitHub
- URL: https://github.com/mohitkyadav/yubico-js
- Owner: mohitkyadav
- License: mit
- Created: 2022-06-25T14:59:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T22:32:57.000Z (over 2 years ago)
- Last Synced: 2025-04-12T00:43:19.536Z (15 days ago)
- Topics: yubico, yubico-otp, yubikey
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/yubico-js
- Size: 134 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yubico-JS
[](https://www.npmjs.com/package/yubico-js) 
An implementation of the [Yubico Validation Protocol](https://developers.yubico.com/yubikey-val/Validation_Protocol_V2.0.html).
## Features
- Verify Yubikey OTPs
## Setup guide
1. Clone the repository.
```bash
npm install
```
2. Get client ID and secret from [Yubico](https://upgrade.yubico.com/getapikey/).
3. Create `.env` file with the following content:```bash
CLIENT_ID="CLIENT_ID"
SECRET_KEY="SECRET_KEY"
OTP="any_otp"```
4. Run the tests.
```bash
npm test
```## Usage
```js
import { Yubico } from 'yubico-js';const yubico = new Yubico({
clientId: 'YOUR_CLIENT_ID',
secretKey: 'YOUR_SECRET_KEY',
});// To verify otp
try {
yubico.verifyOtp(otpString);
} catch (e) {
console.log(e);
}
```## Contributing

[](https://github.com/mohitkyadav/yubico-js/issues)