https://github.com/nsigel/sms-toolkit
🔨 A toolkit of SMS verification client wrappers for Typescript.
https://github.com/nsigel/sms-toolkit
sms-verification smspva textverified truverifi typescript
Last synced: 27 days ago
JSON representation
🔨 A toolkit of SMS verification client wrappers for Typescript.
- Host: GitHub
- URL: https://github.com/nsigel/sms-toolkit
- Owner: nsigel
- Created: 2023-02-04T23:30:16.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-09T14:08:17.000Z (over 2 years ago)
- Last Synced: 2025-04-19T03:35:53.622Z (about 1 month ago)
- Topics: sms-verification, smspva, textverified, truverifi, typescript
- Language: TypeScript
- Homepage:
- Size: 88.9 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🔨 A toolkit of SMS verification clients for Typescript.
This package provides simple wrappers for the usage of SMS verification clients in Node.js.
Included is `Watcher`, a simple tool to wait for and match received messages.## Supported clients:
- [Truverifi](https://truverifi.com/)
- [Textverified](https://textverified.com/) *coming soon*
- [SMSPVA](https://smspva.com/) *coming soon*## Client usage
### Install the package:
```
yarn add sms-toolkit
```
### Initialize a client:
```ts
import { Truverifi, TRUVERIFI_SERVICES } from "sms-toolkit";const client = new Truverifi(
/* API Key */
process.env.TRUVERIFI_API_KEY,
/* Verification target */
TRUVERIFI_SERVICES.GOOGLE_GMAIL
);
```### Start and claim a verification:
```ts
const phoneNumber = await client.startVerification();
// Receive SMS
const messages = await client.claimVerification();
```## Watcher usage
### Initialize Watcher:
```ts
const watcher = new Watcher(client);
```### Wait for messages:
```ts
const newMessage = await watcher.waitForVerification();
```
---
Inspired by [sms](https://github.com/saucesteals/sms).
Created under the MIT license.