1.2.0 • Published 3 years ago

typingdnaclient-rxjs v1.2.0

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

typingdnaclient-rxjs

RxJS wrapper for the TypingDna API

npm Infrastructure Tests

Installation

npm install typingdnaclient-rxjs --save

Instantiation and Usage

import { TypingDNAReactiveClient } from 'typingdnaclient-rxjs';

const client = new TypingDNAReactiveClient(apiKey, apiSecret);
client.verify(userId, pattern).subscribe(console.log, console.error);

The default TypingDNA API Server is api.typingdna.com. You can use the alternative server tdna-api.azurewebsites.net.

const server = 'tdna-api.azurewebsites.net';
const client = new TypingDNAReactiveClient(apiKey, apiSecret, server);

Available Methods

class TypingDNAReactiveClient {
  auto(
    userId: string,
    typingPattern: string,
    options?: { customField: any }
  ): Observable<AutoResponse>;

  save(userId: string, typingPattern: string): Observable<any>;

  verify(
    userId: string,
    typingPattern: string,
    quality: number,
    options: { deviceSimilarityOnly: boolean }
  ): Observable<VerifyResponse>;
}