# @habloapp/unicauth

> Unic Auth SDK package

Latest version **1.0.2** (published 2021-09-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @habloapp/unicauth
pnpm add @habloapp/unicauth
yarn add @habloapp/unicauth
bun add @habloapp/unicauth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-09-08 |
| First published | 2021-09-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 438.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | HabloApp Inc. |
| Maintainers | mschuelter, marcos.habloapp, unicauth |
| Keywords | unicauth, auth, authn, authentication, authz, authorization, 2fa, passwordless |

## Links

- npm: https://www.npmjs.com/package/@habloapp/unicauth
- Repository: https://github.com/habloapp/unicauth
- Homepage: https://unicauth.com/alpha
- Issues: https://github.com/habloapp/unicauth/issues
- npm.io page: https://npm.io/package/@habloapp/unicauth

## Dependencies (2)

- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.0.0
- [superagent](https://npm.io/package/superagent.md) ^5.3.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-09-08
- 1.0.1 — 2021-09-08
- 1.0.0 — 2021-09-08

## README

# Unic Auth

Unic Auth - Node.js client for [Unic Auth API](https://unicauth.com/alpha/docs/)
<br>

Unic Auth allows you to quickly implement userless/passwordless login and 2FA (no more paying for SMS to have 2FA)
<br>

We recommend using our [Unic Auth Wrapper](https://github.com/habloapp/unicauth-wrapper) instead of this module.

## Installation

First make sure to get your credentials on [Unic Auth](https://console.unicauth.com/), if you want to test first, use [Unic Auth - Demo](https://unicauth.com/demo)

### For [Node.js](https://nodejs.org/)

#### npm

Install it via:

```shell
npm install @habloapp/unicauth --save
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var unicauth = require('@habloapp/unicauth');

var api = new unicauth.UnicAuthApi()
var body = new unicauth.Create2FARequest(); // {Create2FARequest} 
var x_ua_appKey = "x_ua_appKey_example"; // {String} Application `appKey`

api.create2FA(body, x_ua_appKey).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

## Documentation for API Endpoints

All URIs are relative to *https://unicauth.com/api*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*Unicauth.UnicAuthApi* | [**create2FA**](docs/UnicAuthApi.md#create2FA) | **POST** /2fa/create/ | Create 2FA
*Unicauth.UnicAuthApi* | [**expireUserSession**](docs/UnicAuthApi.md#expireUserSession) | **POST** user/session/expire | Expire User Session
*Unicauth.UnicAuthApi* | [**getSession**](docs/UnicAuthApi.md#getSession) | **GET** /session/ | Get Session
*Unicauth.UnicAuthApi* | [**getUserSession**](docs/UnicAuthApi.md#getUserSession) | **GET** user/session | Get User Session

## Documentation for Models

 - [Unicauth.Create2FARequest](docs/Create2FARequest.md)
 - [Unicauth.Create2FAResponse](docs/Create2FAResponse.md)
 - [Unicauth.ExpireUserSessionRequest](docs/ExpireUserSessionRequest.md)
 - [Unicauth.ExpireUserSessionRequestData](docs/ExpireUserSessionRequestData.md)
 - [Unicauth.ExpireUserSessionResponse](docs/ExpireUserSessionResponse.md)
 - [Unicauth.ExpireUserSessionResponseData](docs/ExpireUserSessionResponseData.md)
 - [Unicauth.GetSessionResponse](docs/GetSessionResponse.md)
 - [Unicauth.GetSessionResponseData](docs/GetSessionResponseData.md)
 - [Unicauth.GetUserSessionResponse](docs/GetUserSessionResponse.md)
 - [Unicauth.GetUserSessionResponseData](docs/GetUserSessionResponseData.md)
 - [Unicauth.Model2FARequestData](docs/Model2FARequestData.md)
 - [Unicauth.Model2FAResponseData](docs/Model2FAResponseData.md)
 - [Unicauth.ResponseError](docs/ResponseError.md)

---
_Source: https://npm.io/package/@habloapp/unicauth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
