0.0.1 • Published 6 months ago
@vim-crouwel/bsky-util v0.0.1
BlueSkyUtil
A utility for interacting with Bluesky Social. Supports text, image, and video posts.
Features
- Login to Bluesky Social.
- Post text messages.
- Post images (up to 4, max 1MB each).
- Post videos (up to 50MB).
Installation
npm install @atproto/api
Usage
Initialize
import BlueSkyUtil from './BlueSkyUtil'; const blueSky = new BlueSkyUtil();
Login
await blueSky.login('your-handle.bsky.social', 'your-app-password');
Post Text
await blueSky.post('Hello, Bluesky!');
Post Images
import fs from 'fs'; const images = [ { buffer: fs.readFileSync('./image1.jpg'), mimeType: 'jpg', alt: 'Sunrise' }, ]; await blueSky.post('Check out this image!', images);
Post Video
import fs from 'fs'; const videoBuffer = fs.readFileSync('./video.mp4'); await blueSky.postVideo('Cool video!', videoBuffer, 'mp4', 'Demo video');
Media Limits
- Images: Up to 4 per post, each < 1MB.
- Videos: Up to 50MB.
License
MIT License.
0.0.1
6 months ago