File storage

What is Shypyard file storage?

Every Shypyard app (backed by S3) comes with a file storage where files can be uploaded to from the tasks. You can use the file storage to export analytic data like csv of your product information

Usage Example

Using the example from earlier, here's a pseudo code to show upload file to filestorage.

const { auths, libs } = require('platform');

module.exports = async (event, options) => {
  let lines = [
    ['name', 'price'],
    ['xyz', 123],
  ];

  const csv = lines.map((e) => e.join(',')).join('\n');
  console.log(csv);

  const shypyard = libs.shypyard.get();
  await shypyard.files.upload({
    key: `export.csv`,
    data: csv,
  });
};

Web UI

You can see the database value by going to Storage > Files section. Here you can do basic filtering on key prefix. And download files.

Full documentation

Please see the Shypyard SDK documention on shypyard files.

Last updated