Send verification SMS on the service line so carriers deliver the code.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-10 14:10:54 +03:30
co-authored by Cursor
parent 88f6a430d9
commit 0f80de1f05
5 changed files with 19 additions and 1 deletions
+5 -1
View File
@@ -24,6 +24,10 @@ async function main() {
'https://api.meshkee.com/api/v1/public/sms/send';
const apiKey = process.env.MESHKEE_SMS_API_KEY;
const domain = process.env.MESHKEE_SMS_DOMAIN ?? 'manacollections.ir';
const source =
process.argv.includes('--source')
? arg('source')
: (process.env.MESHKEE_SMS_SOURCE ?? '5000110005');
if (!apiKey) throw new Error('MESHKEE_SMS_API_KEY is not set in .env');
if (!/^09\d{9}$/.test(to)) throw new Error('to must match 09xxxxxxxxx');
@@ -35,7 +39,7 @@ async function main() {
'Content-Type': 'application/json',
'X-Api-Key': apiKey,
},
body: JSON.stringify({ domain, to, message }),
body: JSON.stringify({ domain, to, message, source }),
});
const body = await response.json().catch(() => null);