{"id":48185,"library":"interfax","title":"InterFAX Node.js Library","description":"A Node.js wrapper for the InterFAX REST API for sending and receiving faxes. This library, version 0.8.4, supports both promises and callbacks, and allows sending faxes via file paths or URLs. It is transpiled to ES5 for backward compatibility and works with Node 4+. Key differentiators include simple setup with environment variables or direct credentials, support for over 20 file types, and access to account balance and fax management endpoints.","status":"active","version":"0.8.4","language":"javascript","source_language":"en","source_url":"https://github.com/interfax/interfax-nodejs","tags":["javascript","fax","faxing","interfax"],"install":[{"cmd":"npm install interfax","lang":"bash","label":"npm"},{"cmd":"yarn add interfax","lang":"bash","label":"yarn"},{"cmd":"pnpm add interfax","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is the constructor. Using named export (InterFAX) is incorrect; CommonJS require returns the constructor directly.","wrong":"var interfax = require('interfax').InterFAX;","symbol":"InterFAX","correct":"import InterFAX from 'interfax';"},{"note":"Constructor expects an options object, not separate arguments.","wrong":"new InterFAX(username, password);","symbol":"interfax instance","correct":"new InterFAX({ username, password });"},{"note":"No official type definitions are provided; users may need to declare their own types. The module is ESM-compatible but default import is the correct pattern.","wrong":"import { InterFAX } from 'interfax';","symbol":"TypeScript types","correct":"import InterFAX from 'interfax';"}],"quickstart":{"code":"import InterFAX from 'interfax';\n\nconst interfax = new InterFAX({\n  username: process.env.INTERFAX_USERNAME ?? '',\n  password: process.env.INTERFAX_PASSWORD ?? ''\n});\n\ninterfax.outbound.deliver({\n  faxNumber: '+11111111112',\n  file: 'folder/fax.pdf'\n}).then(fax => {\n  console.log('Fax sent, ID:', fax.id);\n}).catch(error => {\n  console.error('Error:', error);\n});","lang":"typescript","description":"Sends a fax using a local PDF file and logs the fax ID or error."},"warnings":[{"fix":"Use new InterFAX({ username: '...', password: '...' }) or set environment variables.","message":"Constructor requires an options object, not positional arguments. Using new InterFAX(username, password) will fail silently or throw an error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use promise-based API (.then/.catch or async/await) instead of callbacks.","message":"Callback patterns are supported but deprecated in favor of promises. The documentation mentions callbacks but they are legacy.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"Always provide username and password either via options or environment variables INTERFAX_USERNAME and INTERFAX_PASSWORD.","message":"Environment variables are checked if no username/password are provided; if neither is set, API calls will fail with authentication error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use 'faxNumber' as the key for the destination fax number.","message":"The deliver method expects 'faxNumber' (not 'fax' or 'number'); misspelling the option name results in a silent success but no fax sent.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use path.resolve(__dirname, 'folder/fax.pdf') or provide a URL.","message":"File paths in the deliver method are relative to the current working directory, not the script directory. Using absolute paths is safer.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.8.4':20 '20':62 '4':47 'access':66 'account':68 'allow':27 'api':11 'backward':41 'balanc':69 'callback':25 'compat':42 'credenti':58 'differenti':49 'direct':57 'endpoint':73 'environ':54 'es5':39 'fax':16,29,71,75,76 'file':31,63 'includ':50 'interfax':1,9,77 'javascript':74 'key':48 'librari':3,18 'manag':72 'node':46 'node.js':2,5 'path':32 'promis':23 'receiv':15 'rest':10 'send':13,28 'setup':52 'simpl':51 'support':21,59 'transpil':37 'type':64 'url':34 'variabl':55 'version':19 'via':30 'work':44 'wrapper':6","created_at":"2026-06-07T16:55:19.969861+00:00","updated_at":"2026-06-07T16:55:19.969861+00:00","problems":[{"fix":"Use interfax.outbound.deliver(options) instead of interfax.deliver(options).","cause":"deliver is a method on interfax.outbound, not on the main interfax instance.","error":"TypeError: interfax.deliver is not a function"},{"fix":"Ensure the options object includes a 'faxNumber' property with a valid international fax number.","cause":"The 'faxNumber' option was not provided or was misspelled.","error":"Error: Missing required field: faxNumber"},{"fix":"Verify credentials or set INTERFAX_USERNAME and INTERFAX_PASSWORD environment variables.","cause":"Invalid username/password or missing environment variables.","error":"Error: Authentication failed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/interfax/interfax-nodejs#readme","github":"https://github.com/interfax/interfax-nodejs","docs":null,"changelog":null,"pypi":null,"npm":"interfax","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}