Skip to content

Instantly share code, notes, and snippets.

@janniks
Created April 29, 2022 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janniks/fff406bd0cc6185b4cf246d82e1c0ec0 to your computer and use it in GitHub Desktop.
Save janniks/fff406bd0cc6185b4cf246d82e1c0ec0 to your computer and use it in GitHub Desktop.
getFile — Stacks Storage
import { AppConfig, UserSession } from "@stacks/connect";
import { Storage } from "@stacks/storage";
const appConfig = new AppConfig(["store_write", "publish_data"]);
const userSession = new UserSession({ appConfig });
const storage = new Storage({ userSession });
const fileName = "car.json";
const options = {
decrypt: true,
};
const fileData = await storage.getFile(fileName, options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment