
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Fanos is a lightweight JavaScript library for reliable data transmission via the Beacon API, with auto-retry, Fetch fallback, batching, and flexible triggers.
Fanos is a lightweight JavaScript promise-based library that simplifies sending asynchronous requests using the Beacon API. It ensures reliable, non-blocking transmission of data to a server, making it ideal for scenarios like analytics, logging, and tracking user interactions. However, it does but not guaranteed if the browser is closed suddenly.
To improve reliability, Fanos includes an optional fallback mechanism using Fetch and supports automatic retrying of failed requests. This ensures that your data is transmitted reliably, even in challenging network conditions.
Beacon API for non-blocking requests.Fetch as a backup if sendBeacon fails.localStorage and retries them.JSON, FormData, URL-encoded data, and Blobs.headers for requests.You can include Fanos in your project via a script tag or install it using npm:
npm install fanos
Include the library directly in your HTML:
<script src="path/to/fanos.umd.min.js"></script>
Use the library via a CDN:
<script src="https://cdn.jsdelivr.net/npm/fanos@latest/dist/fanos.umd.min.js"></script>
Import the library in your JavaScript project:
import Fanos from 'dist/fanos.esm'
Here’s how to get started with Fanos in just a few lines of code:
const fanos = new Fanos({
url: 'https://example.com/api/log',
});
const payload = {
userId: 123,
action: 'login',
details: { browser: 'Chrome', os: 'Windows' },
};
fanos.send(payload)
.then(() => console.log('Sent successfully'))
.catch(err => console.error('Failed to send:', err));
Fanos.configure({
url: 'https://example.com/api/log',
debug: true,
});
Fanos.send(payload)
.then(() => console.log('Sent successfully'))
.catch(err => console.error('Failed to send:', err));
The flush method sends all queued requests immediately.
fanos.flush()
The destroy method cleans up resources and stops retries:
fanos.destroy()
fallbackToFetch option to use Fetch as a fallback mechanism.debug option. This will log internal operations and provide insights into the library's behavior during execution.| Browser/Environment | Support |
|---|---|
| Chrome | Latest ✔ |
| Firefox | Latest ✔ |
| Safari | Latest ✔ |
| Opera | Latest ✔ |
| Edge | Latest ✔ |
| Node.js | No ❌ |
We welcome contributions! Please read the Contributions Guid to learn how to contribute.
See Changelog for release details.
This package is open-source software licensed under the MIT license.
FAQs
Fanos is a lightweight JavaScript library for reliable data transmission via the Beacon API, with auto-retry, Fetch fallback, batching, and flexible triggers.
We found that fanos demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.