Registry / communication / interfax

interfax

JSON →
library0.8.4jsnpmunverified

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.

npm install interfax
INSTALL
IMPORT
SIG · INTERFAX
I
interfax
communicationjavascriptv0.8.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InterFAX
import InterFAX from 'interfax';
var interfax = require('interfax').InterFAX;
The default export is the constructor. Using named export (InterFAX) is incorrect; CommonJS require returns the constructor directly.
interfax instance
new InterFAX({ username, password });
new InterFAX(username, password);
Constructor expects an options object, not separate arguments.
TypeScript types
import InterFAX from 'interfax';
import { InterFAX } from 'interfax';
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.

Sends a fax using a local PDF file and logs the fax ID or error.

import InterFAX from 'interfax'; const interfax = new InterFAX({ username: process.env.INTERFAX_USERNAME ?? '', password: process.env.INTERFAX_PASSWORD ?? '' }); interfax.outbound.deliver({ faxNumber: '+11111111112', file: 'folder/fax.pdf' }).then(fax => { console.log('Fax sent, ID:', fax.id); }).catch(error => { console.error('Error:', error); });
Debug
Known issues
gotchaConstructor requires an options object, not positional arguments. Using new InterFAX(username, password) will fail silently or throw an error.
fix
Use new InterFAX({ username: '...', password: '...' }) or set environment variables.
affects: >=0.0.0
deprecatedCallback patterns are supported but deprecated in favor of promises. The documentation mentions callbacks but they are legacy.
fix
Use promise-based API (.then/.catch or async/await) instead of callbacks.
affects: >=0.8.0
gotchaEnvironment variables are checked if no username/password are provided; if neither is set, API calls will fail with authentication error.
fix
Always provide username and password either via options or environment variables INTERFAX_USERNAME and INTERFAX_PASSWORD.
affects: >=0.0.0
gotchaThe deliver method expects 'faxNumber' (not 'fax' or 'number'); misspelling the option name results in a silent success but no fax sent.
fix
Use 'faxNumber' as the key for the destination fax number.
affects: >=0.0.0
gotchaFile paths in the deliver method are relative to the current working directory, not the script directory. Using absolute paths is safer.
fix
Use path.resolve(__dirname, 'folder/fax.pdf') or provide a URL.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: interfax.deliver is not a function
deliver is a method on interfax.outbound, not on the main interfax instance.
fix
Use interfax.outbound.deliver(options) instead of interfax.deliver(options).
Error: Missing required field: faxNumber
The 'faxNumber' option was not provided or was misspelled.
fix
Ensure the options object includes a 'faxNumber' property with a valid international fax number.
Error: Authentication failed
Invalid username/password or missing environment variables.
fix
Verify credentials or set INTERFAX_USERNAME and INTERFAX_PASSWORD environment variables.
Upgrade
Version history
0.8.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
interfax — npm install interfax · libregistry