
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@jeroenpeeters/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 @jeroenpeeters/react-fullstory receives a total of 1 weekly downloads. As such, @jeroenpeeters/react-fullstory popularity was classified as not popular.
We found that @jeroenpeeters/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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.