The media library stores files in your workspace so you can reference them by ID across multiple posts. Useful for:
- Brand assets (logos, banners) used in many campaigns
- Carousel images shared across platforms
- Long videos you want to clip and reuse
Uploading
typescript
import { readFileSync } from 'fs'
const item = await socifyr.media.upload(
readFileSync('banner.jpg'),
'banner.jpg',
)
console.log(item.id) // 6a04f715d3d7d93575e65d13bash
socifyr media upload banner.jpg --alt "Product banner"Referencing in a post
Pass the media ID (or a public URL) directly — Socifyr won't re-upload:
typescript
await socifyr.uploads.photos({
connections: ['instagram-mybrand'],
medias: ['6a04f715d3d7d93575e65d13'], // ID
text: 'Same banner, new caption',
})
// Or a public URL
await socifyr.uploads.photos({
connections: ['linkedin-myhandle'],
medias: ['https://cdn.example.com/banner.png'],
})
// Or mix raw files, IDs, and URLs in a carousel
await socifyr.uploads.photos({
connections: ['instagram-mybrand'],
medias: [
readFileSync('img1.jpg'),
'6a04f715d3d7d93575e65d13',
'https://cdn.example.com/img3.png',
],
})bash
socifyr post "From the library" \
--media-id 6a04f715d3d7d93575e65d13 \
--to instagram-mybrand
# Or a URL
socifyr post "From a CDN" \
--media-id https://cdn.example.com/banner.png \
--to linkedin-myhandleSupported file types
| Type | Extensions |
|---|---|
| Image | .jpg, .jpeg, .png, .gif, .webp, .heic |
| Video | .mp4, .mov, .avi, .mkv, .webm, .m4v |
| Document | .pdf |
Limits
| Tier | Total storage | Max single file |
|---|---|---|
| Free | 1 GB | 100 MB |
| Pro | 50 GB | 500 MB |
| Business | 500 GB | 2 GB |
Files are stored on S3-compatible object storage and served via signed URLs that expire after 1 hour — the SDK and CLI refresh them automatically.
Managing the library
typescript
// List
const { results, total } = await socifyr.media.list({
type: 'image',
search: 'banner',
limit: 20,
})
// Get one
const item = await socifyr.media.get(id)
// Update metadata
await socifyr.media.update(id, {
alt: 'New alt text',
description: 'Updated description',
tags: ['summer-campaign', 'evergreen'],
})
// Delete
await socifyr.media.delete(id)
await socifyr.media.bulkDelete([id1, id2, id3])