# sms-auth

> MiaJupiter Sms authentication

Latest version **1.1.6** (published 2023-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install sms-auth
pnpm add sms-auth
yarn add sms-auth
bun add sms-auth
```

## 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.1.6 |
| Published | 2023-02-05 |
| First published | 2023-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | MiaJupiter Developer Team |
| Maintainers | shamancoders3 |
| Keywords | sms, auth, miajupiter, verification, phone number, verify, verimor, shamancoders, sms verification |

## Links

- npm: https://www.npmjs.com/package/sms-auth
- Repository: https://github.com/miajupiter/sms-auth
- Homepage: https://github.com/miajupiter/sms-auth#readme
- Issues: https://github.com/miajupiter/sms-auth/issues
- npm.io page: https://npm.io/package/sms-auth

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.3.1

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@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

## Recent versions

- 1.1.6 (latest) — 2023-02-05
- 1.1.5 — 2023-02-05
- 1.1.4 — 2023-02-04
- 1.1.3 — 2023-02-04

## README

<p align="center">
<a href="https://miajupiter.com" _target="blank">
<img src="https://github.com/miajupiter/.github/raw/main/images/miajupiter-logo.png"  width="320" />
</a>

[![](https://img.shields.io/badge/%F0%9F%8C%90%20www-miajupiter.com-blueviolet?style=flat&labelColor=%23323232)](https://miajupiter.com)


# Sms Send AuthCode


[![npm](https://img.shields.io/npm/v/sms-auth?label=npm&logo=npm) ](https://www.npmjs.com/package/sms-auth) [![download](https://img.shields.io/npm/dt/sms-auth?label=downloads&logo=npm)](https://www.npmjs.com/package/sms-auth) [![GitHub](https://img.shields.io/github/license/miajupiter/sms-auth)](https://choosealicense.com/licenses/mit/) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fmiajupiter%2Fsms-auth&count_bg=%236495ED&title_bg=%23323232&icon=cliqz.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) [![](https://img.shields.io/badge/readme-docs-chocolate.svg)](https://github.com/miajupiter/sms-auth#readme) [![](https://img.shields.io/github/stars/miajupiter/sms-auth?color=yellow&label=stars&logo=github)](https://github.com/miajupiter/sms-auth/stargazers)


>Note: This package supports only Verimor Sms service.


## Table of contents

- [Install](#install)
- [API Functions](#api-functions)
  - [Send Authentication Code](#send-authentication-code)
  - [Send SMS](#send-sms)
  - [Generating auth code](#generating-auth-code)
  - [Is valid phone number?](#is-valid-phone-number)
- [License - MIT License](#license---mit-license)


## Install

[From npm source](https://www.npmjs.com/package/sms-auth)
```bash
npm install sms-auth
```
[From github](https://github.com/miajupiter/sms-auth)
```bash
npm install https://github.com/miajupiter/sms-auth.git
```

## API Functions

### Send Authentication Code
```js
const sms=require('sms-auth')

const messageTemplate='This is your auth code:{authCode}'
const username='' // sms service username
const password='' // sms service password
const recipient='target phone number'

sms.sendAuthCode(username, password, recipient, messageTemplate)
  .then(resp=>console.log(resp))
  .catch(err=>console.error(err))
```
> Output:

```js
// Random generated auth code sent to target phone number
474639  
```

### Send SMS
```js
const sms=require('sms-auth')

sms.sendSms({
    url:'https://sms.verimor.com.tr/v2/send.json',
    method:'POST',
    data:{
      username: '',
      password: '',
      messages:[{
        msg:'Hello, world.',dest:'<phone number>'
      }]
    }
  })
  .then(resp=>console.log(resp))
  .catch(err=>console.error(err))

```

> Output:
```js
HttpStatus: 200 OK

{ status: 200, data: 318438489 }
```

### Generating auth code
```js
const sms=require('sms-auth')

const authCode = sms.generateAuthCode()

console.log(authCode)
```
> Output:

```js
// Generate auth code
474639
```

### Is valid phone number?
```js
const sms=require('sms-auth')

const phoneNumber = '101111111111'

console.log(`Is '${phoneNumber}' valid phone number?\nResult:`, sms.validPhoneNumber())
```

> Output:

```bash
Is '101111111111' valid phone number?

Result: false
```


## License - MIT License

Copyright (c) 2023-**Now** [MiaJupiter Technology Inc.](https://miajupiter.com). All rights reserved. We are proud to be [Open Source](https://opensource.org). For full details about the license, please check the `LICENSE` file in the root directory of the source repository.

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