I have a web app that uses firebase realtime database that holds a large json file. Problem with keeping users data separate

I have a basic web app that takes objects from a large json file in the database and lists them onto the page with styling. When the user clicks on an object, it fades out and they can undo this by clicking on it again.

const handleButtonClickKilled = (e, boss) => {   
    if (selectedBosses.includes(boss)) { 
      setSelectedBosses(selectedBosses.filter(b => b !== boss)); 

    } else { 
      setSelectedBosses([...selectedBosses, boss]); };   
      setChangedBossCount(prevCount => Number(prevCount) + 1);
     
  const updateKilled = () => { 
        const db = getDatabase(); 
        const postData = { 
          changed: 'killed'
        } 
 
        const updates = {};  
        updates['/data/' + e.target.id + '/killed'] = postData;
        return update(ref(db), updates); 
      } 
      updateKilled();  
    }  


useEffect(() => { 
  const savedCount = localStorage.getItem('changedBossCount', JSON.stringify(changedBossCount)); 
  if (savedCount) { 
    setChangedBossCount(JSON.parse(savedCount));
  }
}, [changedBossCount]); 

useEffect(() => { 
  localStorage.setItem('ChangedBossCount', (changedBossCount));
}, [changedBossCount]); 

   const handleButtonClickUndo = (e, boss) => { 
    setSelectedBosses(selectedBosses.filter(b => b !==boss)); 
    setChangedBossCount(changedBossCount - 1);
    const removeChange = () => { 
      const database = getDatabase(firebase); 
        const dbRef = ref(database, '/data/' + e.target.id + '/killed');
        remove(dbRef)
    }; 
    removeChange();     
  } 

I need to change my app so that people using the app are not interefering with each others firebase data.

I would like to accomplish this without requiring the user to sign in. Is this even possible? I’ve attmepted generating a random key on login, and saving this key inside the users local storage so they can access their own version of the json data on page load but I’m stuck on how I’m meant to carry over the json data to their own random key node.

Am I going about this the wrong way? I’ve started looking into using firebase storage for my json file and seeing if I have more luck with that, but I wanted to make sure there isn’t a simpler solution before diving into something I’ve never used before.