Use stacks.js Storage in node

has anyone ever tried or knows how to integrate the Stacks Storage library with a script in node?
Technically, to use it you have to authenticate.
How can I authenticate via CLI with Node?
because honestly I did not understand the method of using the code in the example in the documentation

import { UserSession, AppConfig } from '@stacks/auth';
import { Storage } from '@stacks/storage';

const privateKey = '896adae13a1bf88db0b2e7777777872ec6f34cd7e2ff8abae7ec271e05f9d8';
const appConfig = new AppConfig();
const userSession = new UserSession({ appConfig });
userSession.store.getSessionData().userData = <any> {
  appPrivateKey: privateKey,
};
const storage = new Storage({ userSession });

would anyone be kind enough to explain to me how to proceed?

Storage object is probably to much abstraction for using on node, better use connectToGaiaHub of @stacks/storage and then uploadToGaiaHub together with encryptContent of @stacks/encryption.