
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@aics/frontend-insights
Advanced tools
@aics/frontend-insights
Light abstraction API on top of 3rd party monitoring/metrics/analytics tool(s).
This library is useful insofar as 3rd party services are plugged into it; without plugins, it is effectively a noop API.
Plugins are given to the default export of this package, the FrontendInsights
class, which acts as a dispatcher of messages to its configured plugins.
This library defines an interface that must be implemented for each 3rd party service to be usable as a plugin to FrontendInsights
.
The interface is intentionally as generalized as possible. That interface is:
interface FrontendInsightsPlugin {
process(message: FrontendInsightsMessage, context: FrontendInsightsContext): void;
}
External services should be initialized (e.g., given an API key) in a plugin constructor.
Thereafter, it is the decision of the plugin whether to process some, all, or no messages distributed by the FrontendInsights
class.
For example, a plugin that works entirely by monkeypatching the browser's window.onerror
event (as some browser-based exception monitoring services do),
might choose to not process any messages.
An analytics service, on the other hand, might choose to process FrontendInsightsMessageType.UserEvent
and FrontendInsightsMessageType.UserTiming
messages.
Additional plugins and message types may be added as necessary with no concern to existing usages of the library.
If a new message type (FrontendInsightsMessageType
) is added,
it is recommended to add a specific public method to FrontendInsights
for dispatching that type of message, similar to FrontendInsights::dispatchUserEvent
.
import FrontendInsights, { FrontendInsightsContext } from "@aics/frontend-insights";
import AmplitudeNodePlugin from "@aics/frontend-insights-plugin-amplitude-node";
const context: FrontendInsightsContext = {
application: {
name: APP_ID,
version: "4.2.2",
},
userInfo: {
userId: "leaping_kangaroo@example.com",
},
session: {
platform: "Electron"
}
};
const frontendInsights = new FrontendInsights(context, [
new AmplitudeNodePlugin({ apiKey: "abc123" }),
new WhateverPlugin({ ... }), // e.g., could be others...
]);
frontendInsights.dispatchUserEvent({
type: "ANY_STRING",
properties: {
foo: true,
bar: "no",
baz: 123,
},
});
FAQs
Light abstraction API on top of 3rd party monitoring tool(s).
We found that @aics/frontend-insights demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.