
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
chiper-web-logger-metrics
Advanced tools
Lib que contiene varios modulos para capturar el performance y los crashes de Apps basadas en React
yarn add chiper-web-logger-metrics
o
npm i chiper-web-logger-metrics
Metodos | Descripción | Parametros |
---|---|---|
initFirebase | Inicializar firebase, recibe los keys que nos dan en firebase console y retorna una instancia inicializada | initFirebase({apiKey, authDomain, databaseURL, projectId, messagingSenderId, appId}): firebase.app.App |
initPerformance | Inicializa el serivico de performance | initPerformance(): void |
newTrace | Crea un nuevo segumiento | newTrace(traceName: string): void |
startTrace | Inicia un seguimiento previamente creado | startTrace(): void |
stopTrace | Termina un seguimiento | stopTrace(): void |
putAttribute | Agrega un atributo para el seguimiento actual | sputAttribute(key: string, value: string): void |
=> src/config/firebase.ts
import { firebaseService } from 'chiper-web-logger-metrics'
export const initializeApp = firebaseService.initFirebase({
apiKey: "AIzaSyA4v0E23-fake-dZK9HXskasdrfsaZJNLS34FGQ",
authDomain: "projectId.fake.firebaseapp.com",
databaseURL: "https://projectId.firebaseio.com",
projectId: "fake-project-id",
messagingSenderId: "12356789101",
appId: "1:123456789101:fake:3123be123456a123a456789"
});
import { useEffect } from 'react'
import { performanceService } from 'chiper-web-logger-metrics';
export const PrivateRoute = () => {
const location = useLocation();
useEffect(() => {
performanceService.newTrace(location.pathname);
// code
}, []);
return ()
}
import { useEffect } from 'react'
import { performanceService } from 'chiper-web-logger-metrics';
export const PrivateRoute = () => {
const location = useLocation();
useEffect(() => {
performanceService.startTrace();
performanceService.putAttribute("storeID", storeId);
// code
}, []);
return ()
}
import { useEffect } from 'react'
import { performanceService } from 'chiper-web-logger-metrics';
export const PrivateRoute = () => {
const location = useLocation();
useEffect(() => {
// code
return () => {
performanceService.stopTrace();
};
}, []);
return ()
}
Metodos | Descripción | Parametros |
---|---|---|
startReporting | Inicializar gcp(Error reporting) con los keys q nos da google console cuando creamos un proyecto | startReporting(keys: InitGoogleEntity): void |
reportError | Reportar un error que quedara en los logs de la consola de error reporting | recordError(error: Error, jsErrorName?: string) |
import { useEffect } from 'react'
import { googleService } from 'chiper-web-logger-metrics';
export const Main = () => {
useEffect(() => {
googleService.startReporting({
key: REACT_APP_GCP_KEY,
projectId: REACT_APP_GCP_PROJECT_ID,
service: REACT_APP_GCP_SERVICE,
version: REACT_APP_GCP_VERSION
});
}, []);
return ()
}
import { googleService } from 'chiper-web-logger-metrics';
axios.interceptors.response.use(
(response) => response,
(error) => {
// code ...
googleService.reportError(error, myStoreId);
return Promise.reject(error);
}
);
FAQs
Chiper logger metrics for web
The npm package chiper-web-logger-metrics receives a total of 0 weekly downloads. As such, chiper-web-logger-metrics popularity was classified as not popular.
We found that chiper-web-logger-metrics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.