Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-fullstory
Advanced tools
A component to run FullStory in your React application. This is safe to use both on the client and in a server-rendered environment. If you run into issues, please submit an issue. Pull requests are also welcome!
NPM:npm i react-fullstory --save
Yarn:yarn add react-fullstory
Include the <FullStory />
component somewhere in your application - probably in the top-most component.
import { Component } from 'react';
import FullStory from 'react-fullstory';
const ORG_ID = 'XXXXX'; // Fill this in here
export class App extends Component {
render() {
return (
<div className="app">
<FullStory org={ORG_ID} />
</div>
);
}
}
Other props that you may specify (other than org
) are: debug
, host
, and namespace
.
This loads FullStory at the creation of the component and places the script appropriately in the page. This library allows for the calling of any function FullStory currently has, or will ever have, in their library.
import { FullStoryAPI } from 'react-fullstory';
// Identify method
FullStoryAPI('identify', userId, {
custom_var_1: 'Hello',
custom_var_2: 'World'
});
// SetUserVars method
FullStoryAPI('setUserVars', {
custom_var_3: 'Hello',
custom_var_4: 'World'
});
The following aliases have been provided for methods currently available in the FullStory API.
You can import these from the library to use
import { identify, setUserVars } from 'react-fullstory';
// Identify method
identify(userId, {
custom_var_1: 'Hello',
custom_var_2: 'World'
});
// SetUserVars method
setUserVars({
custom_var_3: 'Hello',
custom_var_4: 'World'
});
In order to get things running locally, you can use the following commands:
yarn install
- installs all dev dependenciesyarn start
- starts the Babel compilerIf you also want to run the examples, you will have to do a little extra work.
cd examples
- Change your terminal into the examples
folderyarn install
and yarn start
. This is simply a create-react-app running inside the examples
folder.src/index.js
, you'll need to kill the CRA server, remove your examples/node_modules
folder and repeat step 2. This is a minor pain in the ass, but I haven't found a quicker way yet.I would LOVE to see some PR's on getting local development improved!
yarn build
This will compile your code into the dist
. You should never need to run this manually as the whole build process is taken care of for you in other scripts.
yarn test
- one-time run through of your tests, also generates your coverage report. You won't likely need to run this yourself.
yarn test:watch
- live-reloading your test suite upon file save, good for development
FAQs
A simple SSR-ready wrapper for FullStory in React
The npm package react-fullstory receives a total of 11,404 weekly downloads. As such, react-fullstory popularity was classified as popular.
We found that react-fullstory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.