@getlatedev/social-media-api
v1.1.0
Published
Drop-in replacement for the Ayrshare social-media-api SDK, powered by Late
Maintainers
Readme
@getlatedev/social-media-api
Drop-in replacement for the Ayrshare social-media-api SDK, powered by Late.
Migration
npm uninstall social-media-api
npm install @getlatedev/social-media-apiThen update your import:
- import SocialMediaAPI from 'social-media-api';
+ import SocialMediaAPI from '@getlatedev/social-media-api';
const social = new SocialMediaAPI('your_late_api_key');That's it. All method signatures are identical to the Ayrshare SDK.
Get Your API Key
- Sign up at getlate.dev
- Go to Settings > API Keys
- Create a new API key
Example
import SocialMediaAPI from '@getlatedev/social-media-api';
const social = new SocialMediaAPI('your_late_api_key');
// Post to multiple platforms
const result = await social.post({
post: "Check out Late - social media scheduling for developers!",
platforms: ["twitter", "instagram", "linkedin"],
mediaUrls: ["https://example.com/image.jpg"],
});
// Get post history
const history = await social.history({ lastRecords: 10 });
// Upload media
const upload = await social.upload({
file: base64EncodedFile,
fileName: "photo.jpg",
});Supported Methods
Fully Implemented
All core Ayrshare SDK methods are fully supported with identical request/response formats.
| Category | Methods |
|----------|---------|
| Posts | post, delete, getPost, retryPost, updatePost |
| History | history |
| User | user |
| Profiles | createProfile, deleteProfile, updateProfile, getProfiles |
| Media | upload, media, mediaUploadUrl, verifyMediaExists |
| Analytics | analyticsPost, analyticsSocial |
| Comments | postComment, getComments, deleteComments, replyComment |
| Webhooks | registerWebhook, unregisterWebhook, listWebhooks |
| Scheduling | setAutoSchedule, deleteAutoSchedule, listAutoSchedule |
| Hashtags | checkBannedHashtags |
| Reviews | reviews, review, replyReview, deleteReplyReview |
Not Yet Available
These methods are included in the SDK for API compatibility but return a 501 status with a descriptive message. They will be implemented as Late adds support.
| Category | Methods |
|----------|---------|
| AI Generation | generatePost, generateRewrite, generateTranscription, generateTranslation, generateAltText |
| RSS Feeds | feedAdd, feedDelete, feedGet, feedUpdate |
| Hashtag Tools | autoHashtags, recommendHashtags |
| URL Shortening | shortLink, shortLinkAnalytics |
| Media Tools | resizeImage, mediaMeta |
| Analytics | analyticsLinks |
| Profiles | unlinkSocial, generateJWT |
| Brand | getBrandByUser |
Profile-Key Header
To scope requests to a specific profile, pass the Profile-Key header:
social.setProfileKey('your_profile_key');
// All subsequent requests will be scoped to this profile
const history = await social.history({ lastRecords: 10 });You can find your profile keys via social.getProfiles().
License
MIT
