
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@vyro-x/react-insights-client
Advanced tools
Client-side insights system integration for React & Next.js
npm i @vyro-x/react-insights-client
or
pnpm i @vyro-x/react-insights-client
Wrap your app with the InsightsProvider
import { InsightsProvider, CollectorApi } from '@vyro-x/react-insights-client';
import { authService } from '@vyro-x/react-auth';
import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import { App } from './App';
const container = document.getElementById('root');
if (!container) throw new Error('Failed to find the root element');
const root = ReactDOM.createRoot(container);
const collectorApi = new CollectorApi({
endpoint: process.env.REACT_APP_COLLECTOR_API_URL,
getAccessToken: authService.tokens.getAccessToken,
});
root.render(
<React.StrictMode>
<InsightsProvider collectorApi={collectorApi}>
<App />
</InsightsProvider>
</React.StrictMode>,
);
Track events using the useInsights hook.
import { useInsights, EventInput } from '@vyro-x/react-insights-client';
export default function Page() {
const { trackEvent } = useInsights();
return (
<button
onClick={() =>
trackEvent({
type: EventInput.type.CLICK,
// ...
})
}
>
My button
</button>
);
}
The collector-api is deployed to the following URLs:
REACT_APP_COLLECTOR_API_URL=http://127.0.0.1:3020
For the dev env these are:
REACT_APP_COLLECTOR_API_URL=https://collector-api.vyrolabs.net
And in production they are:
REACT_APP_COLLECTOR_API_URL=https://collector-api.vyro.com.au
FAQs
Insights client for React
The npm package @vyro-x/react-insights-client receives a total of 249 weekly downloads. As such, @vyro-x/react-insights-client popularity was classified as not popular.
We found that @vyro-x/react-insights-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.