shuttl-ui-sdk
v0.0.2-1.exp.3
Published
Shuttl's frontend typescript utils and other common case stuff.
Downloads
24
Keywords
Readme
Shuttl UI SDK
Shuttl's common use UI utilities, types, constants, etc.
Install
yarn add shuttl-ui-sdk
Note:
Multiple dependencies listed below are optional, and may need to be installed separately depending on the module you're using.
If you're using the Unified imports approach, they all must be installed separately, depending on whether your build system supports tree-shaking.
List of possibly required dependencies:
- react
- react-dom
- prop-types
- axios
- @material-ui/utils
- @material-ui/styles
- @material-ui/core
- @material-ui/icons
Usage
Path imports (JS and TS)
import { setSentryScope, initSentry, identifyUserOnLogRocket } from 'shuttl-ui-sdk/dist/utils/frontend-tracking';
import { getUrlParts } from 'shuttl-ui-sdk/dist/utils/dom';
import { REQUEST_STATE } from 'shuttl-ui-sdk/dist/globals/constants';
// ...
setSentryScope(...);
identifyUserOnLogRocket(...);
const { domain, subdomain, protocol } = getUrlParts('https://service-panel-frontend.shuttltech.com');
if (someRequestState === REQUEST_STATE.REQUEST) { ... }
Unified imports (JS only)
import { setSentryScope, initSentry, identifyUserOnLogRocket, getUrlParts, REQUEST_STATE } from 'shuttl-ui-sdk';
// ...
setSentryScope(...);
identifyUserOnLogRocket(...);
const { domain, subdomain, protocol } = getUrlParts('https://service-panel-frontend.shuttltech.com');
if (someRequestState === REQUEST_STATE.REQUEST) { ... }