dha-security
v2.4.0
Published
Typescript module for adding security functions to web applications
Downloads
14
Readme
dha-security
A security module for the DHA SDK to help prevent malicious attacks on applications built with the SDK
Getting Started
Install
Install from npm:
- npm i dha-security devtools-detect
Security Module
App.tsx - Functional component
import { CssBaseline, ThemeProvider } from '@material-ui/core';
import { Layout } from 'components';
import { Routes } from 'containers';
import { crashIfDevToolsOpened } from 'dha-security';
import React, { useEffect } from 'react';
import { Provider } from 'react-redux';
import { store } from 'redux/store';
import 'typeface-roboto';
import { theme } from './theme';
const App = () => {
useEffect(() => {
// If dev tools are opened, the application will crash.
crashIfDevToolsOpened();
}, []);
return (
<Provider store={store}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Layout>
<Routes />
</Layout>
</ThemeProvider>
</Provider>
);
};
export default App;
App.tsx - Class component
import { CssBaseline, ThemeProvider } from '@material-ui/core';
import { Layout } from 'components';
import { Routes } from 'containers';
import { crashIfDevToolsOpened } from 'dha-security';
import React from 'react';
import { Provider } from 'react-redux';
import { store } from 'redux/store';
import 'typeface-roboto';
import { theme } from './theme';
class App extends React.Component {
componentDidMount(): void {
// If dev tools are opened, the application will crash.
crashIfDevToolsOpened();
}
render() {
return (
<Provider store={store}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Layout>
<Routes />
</Layout>
</ThemeProvider>
</Provider>
);
}
}
export default App;
Contribute
see Github wiki
NPM
https://www.npmjs.com/package/dha-security
License
pending