Skip to content

A simple way to send and verify verification code with SMS, Email, Telegram and etc.

Notifications You must be signed in to change notification settings

CUBETIQ/verifyme-sdk-node

Repository files navigation

Verifyme SDK for Node [JS/TS]

A simple way to send and verify verification code with SMS, Email, Telegram and etc.

  • Send verify code.
  • Verify a code.
  • VerifyBotAuth.

Supported Providers

  • Telegram / VerifyBot (telegram or verifybot)
  • SMS (Twilio, sms)
  • Email (email)

Usages

Verify Feature

  • Create a verify message and send it to the target.
const API_KEY = 'vm_gX9WwSdKatMNdpUClLU0IfCx575tvdoeQ';
const sdk = Verifyme.create(VerifymeOptions.builder().apiKey(API_KEY).build());

const request = CreateVerifyRequest.builder()
    .provider(Provider.VerifyBot)
    .target('YOUR-CHAT-ID')
    .template('Your verification code is {{code}}')
    .build();

const response = await sdk.send(request);
console.log('Request: ', request);
console.log('Response: ', response);
  • Verify the message.
const request = VerifyMessageRequest.builder()
    .token('5914b15eca02f53d5c0ae8f04a221c98c0813271346c2092021df56de9aa9fd4')
    .code('1234')
    .build();

const response = await sdk.verify(request);
console.log('Request: ', request);
console.log('Response: ', response);

VerifyBotAuth Feature

  • Create an auth state request with the target.
const API_KEY = 'vm_gX9WwSdKatMNdpUClLU0IfCx575tvdoeQ';
const sdk = Verifyme.create(VerifymeOptions.builder().apiKey(API_KEY).build());

const request: VerifyBotAuthCreate = {
    target: '+855769995149',
    type: 'telegram_bot',
};

const response = await sdk.botAuth().auth(request);
console.log('Request: ', request);
console.log('Response: ', response);
  • Get the auth state.
const result = await sdk.botAuth().state(response.state!);
console.log('State: ', state);
console.log('Result: ', result);

Contributors

About

A simple way to send and verify verification code with SMS, Email, Telegram and etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published