Skip to content

Instantly share code, notes, and snippets.

@malerba118
Last active April 13, 2023 16:43
Show Gist options
  • Save malerba118/a5b24153dbc122863547cadda55b5530 to your computer and use it in GitHub Desktop.
Save malerba118/a5b24153dbc122863547cadda55b5530 to your computer and use it in GitHub Desktop.
import { BinstaClient } from 'binsta';
const FOLDER_ID = 'nw6iuC4rIK';
const binsta = new BinstaClient(process.env.API_TOKEN);
const file = await binsta.files.get('JZ7tbWj45g');
const root = await binsta.folders.get('root');
const untitled = await binsta.folders.create();
const photos = await binsta.folders.create({ name: 'photos' });
const file = await binsta.files.create({ name: 'my-file' });
const url = await binsta.files.createSignedUploadUrl({ file_id: file.id });
await binsta.files.upload(url, file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment