Interactive CLI for enriching and aggregating FullStory data.
npm install fullstory-clinpm i fullstory-cli -g.Next, we need to create a story.js file in the root of our project. The story.js
allows us to configure the CLI with the various options:
- apiKey: This is the API key you get out of FullStory. This is required.
- routes: This is a array of { route: string, page: string } that
we can normalize our routes to. The routes table uses path-to-regexp
under the hood to allow you to normalize complex URLs to human readable ones.
- transforms: This is a key/value map of properties we can use to transform data attributes.
- blacklists: This is a key/value map of properties that we want to exclude certain values from.
An example story.js might look like:
``js`
module.exports = {
"apiKey": "XXXXXXXXXXXXXXXXXXXXX",
"blacklists": {
"Customer": [
"sandbox",
],
"UserEmailDomain": [
'bob.com'
]
},
"transforms": {
"Customer": (data) => {
return data.PageUrlOrigin.replace('https://', '')
}
},
"routes": [
{ "route": "/dashboard", "page": "/dashboard" },
{ "route": "/users/:id", "page": "/users/details" },
{ "route": "/users/:id/:tab?", "page": "/users/details" }
]
};
Now that everything is configured, we can run our CLI. The CLI can be ran
interactively which allows a user to type in values dynamically or via
command line arguments.
To run the CLI interactively, you can do sbc or if you wantsbc --offset=1 --type=JSON --aggregate=true`.
to run it your command line arguments like: