
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@baselime/react-rum
Advanced tools
Baselime enables observability for the next generation of cloud applications.
This library enables you to monitor real-user behaviour of your React and Next.js applications.
npm i --save @baselime/react-rum
Add the BaselimeRum Component at the root of your React application application.
Get the
publicApiKeyfrom the Baselime console. Make sure to use a public API key.
function Page({ child }) {
return (
<BaselimeRum apiKey={publicApiKey}>
{child}
</BaselimeRum>)
}
The following data is automatically captured for every page view of your application:
timezonelanguageosuserAgenturldevicecountrycityAdditionally, you can enable capturing web vitals from your React applications. Use the enableWebVitals prop.
Load this at the top of your application to avoid resending the web vital data.
import { BaselimeRum } from '@baselime/react-rum';
function Page({ child }) {
return (
<BaselimeRum apiKey={publicApiKey} enableWebVitals>
{child}
</BaselimeRum>)
}
BaselimeRum automatically captures and sends any Unhandled Errors in your application to Baselime.
import { BaselimeRum } from '@baselime/react-rum';
function Page({ child }) {
return (
<BaselimeRum apiKey={publicApiKey} enableWebVitals fallback={<div>Something went wrong</div>}>
{child}
</BaselimeRum>)
}
To provide a better UX for end users, use React Error Boundaries.
The BaselimeErrorBoundary catches errors in any of its child components, reports the error to Baselime. It works in conjunction with the <BaselimeRum /> Component so that all errors are correlated by Page Load, and User Session.
import { BaselimeErrorBoundary } from '@baselime/react-rum';
function UserProfile({ child }) {
return (<BaselimeErrorBoundary fallback={<div>Could not display your user profile</div>}>
<UserProfileImage />
<UserName />
<UserBiography />
</BaselimeErrorBoundary>
)
}
This is based on the excellent react-error-boundary project.
Error Boundaries do not catch errors inside event handlers. To catch Exceptions
import { useBaselimeRum } from '@baselime/react-rum';
function MyButtonComponent() {
const { captureException } = useBaselimeRum();
function handleClick(e) {
try {
// Do something that could throw
} catch (error) {
// sends errors to Baselime so they can be fixed
captureException(error)
}
}
return <button onClick={handleClick}>Click Me</button>
}
Capture custom events for analytics and monitoring. Like logs but with all the power of Baselime.
sendEvent(message: string, payload)
import { useBaselimeRum } from '@baselime/react-rum';
function CheckoutComponent() {
const { sendEvent } = useBaselimeRum();
function handleClick() {
const checkoutSession = await createImaginaryCheckoutSession()
sendEvent("Checkout Started", {
...checkoutSession
})
}
return <button onClick={handleClick}>Checkout</button>
}
To set the User from another component then call
import { useBaselimeRum } from '@baselime/react-rum';
function UserCard({ child }) {
const { setUser } = useBaselimeRum();
function login(user) {
setUser(user.id);
}
return (
<Button onClick={login}>Login</Button>
}
Once the data is captured, you can query, search and analyse your data in the Baselime console. You can create dashboards and alerts based on the Real User Monitoring metrics.
| Parameter | Description |
|---|---|
apiKey | Your Baselime API key for authentication and authorization. |
enableWebVitals | (Optional) A boolean flag indicating whether to enable tracking of web vitals. |
enableLocal | (Optional) A boolean flag indicating whether to enable local tracking. |
dataset | (Optional) The dataset to store the data to. Defaults to web. |
service | The name of the application being monitored. Defaults to the hostname. |
fallback | A fallback UI component in case the application crashes |
© Baselime Limited, 2023
Distributed under MIT License (The MIT License).
See LICENSE for more information.
FAQs
Optimise the real world performance of your react applications
The npm package @baselime/react-rum receives a total of 5,874 weekly downloads. As such, @baselime/react-rum popularity was classified as popular.
We found that @baselime/react-rum demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.