npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fullstory-asset-sdk

v1.0.0

Published

A lightweight SDK for integrating FullStory session tracking and asset uploading, designed for React apps and CLI automation.

Readme

FullStory Asset SDK

A lightweight SDK for integrating FullStory session tracking and asset uploading into React applications with CLI automation.

Table of Contents


Installation Guide

Prerequisites

  • Node.js >=14.0
  • npm or yarn installed
  • A FullStory API Key
  • A valid FullStory Organization ID (orgId)

Installation

You can install the package using npm or yarn:

npm install fullstory-asset-sdk
# or
yarn add fullstory-asset-sdk

This will install:

  • A React Provider Component (FullStoryProvider) for easy integration.
  • A CLI tool (fullstory-uploader) for manual asset uploads.
  • A cross-platform asset uploader to manage FullStory assets.

Usage Documentation

1. Using the FullStory Provider in a React App

To dynamically track sessions and manage FullStory, wrap your application with the FullStoryProvider:

import React from "react";
import { FullStoryProvider } from "fullstory-asset-sdk";

function App() {
  return (
    <FullStoryProvider
      apiKey="fs-api-key-here"
      assetMapPath="path/to/asset_map.json"
      orgId="your-org-id"
    >
      <h1>My React App</h1>
    </FullStoryProvider>
  );
}

export default App;

2. CLI Tool for Asset Uploading

The package includes a command-line interface (CLI) for manually uploading assets.

npx fullstory-uploader -k YOUR_API_KEY -a path/to/asset-map.json

CLI Options

| Option | Description | | ----------------------- | ------------------------------------------ | | -k, --apiKey <key> | FullStory API Key (required) | | -a, --assetMap <path> | Path to the Asset Map JSON file (required) |

This command uploads assets to FullStory, ensuring they are correctly mapped.


Configuration Options

When using FullStoryProvider, you need to pass:

  • apiKey (Required) - Your FullStory API Key
  • orgId (Required) - Your FullStory Organization ID
  • assetMapPath (Required) - Path to your asset map file

Example:

<FullStoryProvider apiKey="your-api-key" orgId="your-org-id" />

Implementation Examples

1. JavaScript React Project

This package fully supports JavaScript projects even though it is written in TypeScript. You can directly use it in a JS-based React app.

import { FullStoryProvider } from "fullstory-asset-sdk";

function App() {
  return (
    <FullStoryProvider
      apiKey="fs-api-key-here"
      assetMapPath="path/to/asset_map.json"
      orgId="your-org-id"
    >
      <h1>My React App</h1>
    </FullStoryProvider>
  );
}

export default App;

2. Using with Next.js

If using Next.js, import FullStoryProvider inside _app.js:

import { FullStoryProvider } from "fullstory-asset-sdk";

function MyApp({ Component, pageProps }) {
  return (
    <FullStoryProvider
      apiKey="fs-api-key-here"
      assetMapPath="path/to/asset_map.json"
      orgId="your-org-id"
    >
      <Component {...pageProps} />
    </FullStoryProvider>
  );
}

export default MyApp;

3. Integrating with Webpack/Vite

For Webpack or Vite projects, ensure the asset uploader runs before build.

Example Webpack config:

module.exports = {
  plugins: [
    new webpack.DefinePlugin({
      "process.env.FS_API_KEY": JSON.stringify(process.env.FS_API_KEY),
    }),
  ],
};

Troubleshooting

Common Issues

1. FullStory Not Loading

  • Ensure the API key and orgId are correct.
  • Check the console for errors using:
    npx fullstory-uploader -k YOUR_API_KEY -a path/to/asset-map.json

2. Asset Upload Fails

  • Verify assetMapPath is correct.
  • Check internet connectivity.

3. CLI Command Not Found

If the CLI tool isn’t recognized:

npx fullstory-uploader --help

or try reinstalling:

npm install -g fullstory-asset-sdk

Contributing Guidelines

Project Structure

fullstory-asset-sdk/
│── src/
│   ├── FullStoryProvider.tsx      # React Provider Component
│   ├── fullstoryUploader.ts       # Asset upload logic
│   ├── index.ts                   # Package entry point
│   ├── cli.ts                      # CLI command script
│   ├── generate-asset-map-id.js    # Cross-platform asset uploader
│── tests/                          # Jest test files
│── package.json                    # Package metadata & dependencies
│── README.md                       # Documentation

Development Setup

To set up the project locally:

git clone https://github.com/CarGDev/fullstory-asset-sdk.git
cd fullstory-asset-sdk
npm install

To run tests:

npm test

Submitting Issues

Before opening an issue:

  • Check existing issues to avoid duplicates.
  • Provide steps to reproduce the problem.
  • Include error messages and logs.

Create an issue here: GitHub Issues


Technical Details

1. How the Package Works

  • Cross-Platform Asset Uploading:

    • The script (generate-asset-map-id.js) detects OS and downloads the correct FullStory asset uploader binary.
  • Dynamic Asset Map Handling:

    • The provider fetches the asset map dynamically during app initialization.
  • Optimized Performance:

    • The SDK only loads FullStory when needed.
    • Avoids reloading FullStory on re-renders.

2. Security Considerations

  • API keys should never be hardcoded.
  • Use environment variables to store credentials.
    export FS_API_KEY="your-api-key"

Final Notes

This SDK makes FullStory integration seamless by automating:

  • Session tracking
  • Asset management
  • React provider initialization

For any issues or contributions, check:
👉 GitHub Repository