Node.js NPM
Javascript based Node.js NPM Package for Ayrshare

Overview of Node JS Social Media Module

Install the Social-Post-API NPM Client Package if you use Node.js on the server-side. The package simplifies the calls by wrapping the RESTful calls.
Obtain your secret API Key at www.ayrshare.com

Installation

1
npm i social-post-api
Copied!

General Usage

Examples of Post, History, and Delete:
1
const SocialPost = require("social-post-api");
2
const API_KEY = "API KEY"; // get an API Key at ayrshare.com
3
const social = new SocialPost(API_KEY);
4
5
const run = async () => {
6
/** post */
7
const post = await social.post({
8
post: "One more time",
9
platforms: ["twitter", "facebook", "linkedin"],
10
}).catch(console.error);
11
console.log(post);
12
13
/** history */
14
const history = await social.history().catch(console.error);
15
console.log(history);
16
17
/** delete */
18
const deletePost = await social.delete({ id: post.id }).catch(console.error);
19
console.log(deletePost);
20
};
21
22
run();
Copied!

Video Overview of the Social Media API NPM Package

​

More Information and Documentation

Last modified 2d ago