Skip to content

zernio-dev/social-media-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@zerniodev/social-media-api

Drop-in replacement for the Ayrshare social-media-api SDK, powered by Zernio.

Migration

npm uninstall social-media-api
npm install @zerniodev/social-media-api

Then update your import:

- import SocialMediaAPI from 'social-media-api';
+ import SocialMediaAPI from '@zerniodev/social-media-api';

const social = new SocialMediaAPI('your_zernio_api_key');

That's it. All method signatures are identical to the Ayrshare SDK.

Get Your API Key

  1. Sign up at zernio.com
  2. Go to Settings > API Keys
  3. Create a new API key

Example

import SocialMediaAPI from '@zerniodev/social-media-api';

const social = new SocialMediaAPI('your_zernio_api_key');

// Post to multiple platforms
const result = await social.post({
  post: "Check out Zernio - 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 Zernio 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

About

Drop-in replacement for the Ayrshare social-media-api SDK, powered by Zernio

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors