New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mail-code-fetcher

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mail-code-fetcher

Fetch email accounts from vendor API and retrieve OTP/security code via polling.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mail-code-fetcher

Fetch email accounts from vendor API and retrieve OTP/security code via polling.

Install

npm i mail-code-fetcher
# or local path during development
npm i ./packages/mail-code-fetcher

Usage (Library)

const { fetchAccounts, fetchCode } = require('mail-code-fetcher');

(async () => {
  // 1) Get accounts from vendor
  const accounts = await fetchAccounts({
    apikey: process.env.ACCOUNT_API_KEY,
    // optional overrides
    // account_api: 'https://api.dongvanfb.net/user/buy',
    // account_type: 1,
    // quality: 1,
    // type: 'full',
  });

  if (!accounts.length) return console.log('No accounts');

  // 2) Fetch OTP code for one account
  const code = await fetchCode(accounts[0], {
    timeoutMs: 120000, // optional
    delayMs: 8000,     // optional
    // endpoint: 'https://tools.dongvanfb.net/api/get_messages_oauth2',
  });

  console.log({ email: accounts[0].email, code });
})();

CLI

# Show help
npx mail-code-fetcher help

# Fetch accounts
npx mail-code-fetcher fetch-accounts --apikey YOUR_API_KEY

# Fetch code for a single account
npx mail-code-fetcher fetch-code \
  --email user@example.com \
  --refresh REFRESH_TOKEN \
  --client CLIENT_ID \
  --timeout 120000 \
  --delay 8000

API

  • fetchAccounts({ apikey, account_api?, account_type?, quality?, type?, timeoutMs? })
    • Returns: Array<{ email, password, refreshToken, clientId }>
  • fetchCode({ email, refreshToken, clientId }, { timeoutMs?, delayMs?, endpoint? })
    • Returns: string | null

Notes

  • This package is a light wrapper. It does not store anything, just fetches/parses data.
  • Keep your API keys in environment variables.

Keywords

email

FAQs

Package last updated on 12 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts