Socket
Socket
Sign inDemoInstall

dtrum-react-hooks

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dtrum-react-hooks

Dynatrace tools and react hooks collection


Version published
Maintainers
1
Created

Readme

Source

Dynatrace react hooks and tools

useDtrumEndSession

import { useDtrumEndSession } from 'dtrum-react-kit/hooks';

const App = () => {
  useDtrumEndSession(); // Sends close session action when App was closed by closed tab or window
  
  return (<div />);
};

useDtrumListener

import { useDtrumListener } from 'dtrum-react-kit/hooks';

const App = () => {
  useDtrumListener(); // Save the current data-test-id to the global variable _dtElementId, used in the Dynatrace dashboard

  return (<div />);
};

useDtrumOnMount

import { useDtrumOnMount } from 'dtrum-react-kit/hooks';

const pageName = 'Home';

const App = () => {
  useDtrumOnMount(pageName); // Send on first mount component 

  return (<div />);
};
dtrumEndSession
import { dtrumEndSession } from 'dtrum-react-kit/tools';

const App = () => {
  const [user, setUser] = useState(null);

  const logout = () => {
    setUser(null);
    dtrumEndSession(); // Fire action about session ending
  };
  
  return (<div />);
};
sendDtrumAction
import { sendDtrumAction } from 'dtrum-react-kit/tools';

const App = () => {
  const [user, setUser] = useState(null);

  const onClickHandler = () => {
    sendDtrumAction('Click on button');
  };
  
  return (<button onClick={onClickHandler} />);
};

Keywords

FAQs

Last updated on 07 Mar 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc