UNPKG

sms-verifier

Version:

ESP32 + SIM800L ile çalışan basit SMS doğrulama kütüphanesi

23 lines (20 loc) 745 B
const { SmsVerifier } = require('../index'); (async () => { // ESP32'nin IP adresi const v = new SmsVerifier({ espUrl: 'http://192.168.1.100', // ESP32'nin IP adresi apiKey: 'YOUR_ESP32_API_KEY' // ESP32'de tanımladığınız API anahtarı }); try { // SMS gönderme testi console.log('Telefon numarası gönderiliyor...'); const sendResult = await v.sendCode('+90555XXXXXXX'); console.log('Sonuç:', sendResult); // Kod doğrulama testi console.log('\nKod doğrulanıyor...'); const verifyResult = await v.verifyCode('+90555XXXXXXX', '123456'); console.log('Doğrulama sonucu:', verifyResult); } catch (error) { console.error('Hata:', error.message); } })();