Social kit is a unified API infrastructure for social media built with nodejs. Also its a npm package. The project is under construction and has not yet been completed for all platforms. Wouldn't you like to contribute to the development?
https://www.npmjs.com/package/socialkit
- Bluesky: https://bsky.app/ (made with @atproto/api)
- Reddit: https://reddit.com/ (made with official api/axios)
- Make sure you have Node.js and npm installed. Node.js Installation
- Create a new directory
mkdir socialkit-project
cd socialkit-project- Install NPM
npm init -y- Install package:
npm install socialkitFirst you need to call the client with your account details. Then you need to login.
import socialkit from 'socialkit'
const bskyClient = new socialkit.BskyClient('username.bsky.social', 'your-password')
await bskyClient.login()The client constructor has 3 params:
- The username
- The password
- Debug mode (default: false): It's a switch to open debug console logs.
Note: After this the client is ready to use. Do not forget to login first.
| Method | Description | Parameters |
|---|---|---|
login() |
Logs in using the provided username and password. | None |
getTimeline |
Fetches a timeline of posts from the authenticated account. | type (default: null), limit (default: 10), includeSelf (default: true) |
getProfile |
Fetch detailed profile info for the given handle or the logged-in user. | handle (Optional) |
getProfilePosts |
Get posts from a specific profile or from the logged-in user. | handle (Optional), type (default: 'post'), limit (default: 10) |
getFollows |
Get a list of users the current user is following. | handle (Optional), limit (default: 100) |
getFollowers |
Get a list of users following the current user. | handle (Optional), limit (default: 100) |
getNonMutualFollows |
Get users you follow but who do NOT follow you back. | limit (default: 100) |
replyToPost |
Reply to a specific post. | text, parentUri |
newPost |
Creates a new post. | text, imageUrls (default: []) |
likePost |
Like a specific post. | uri, cid |
parseFeedItem |
Clean and normalize a feed item. | item |
Note: Handle is the username like "ranork.bsky.app"
First you need to call the client with your account details. Then you need to login.
import socialkit from 'socialkit'
const redditClient = new socialkit.RedditClient('client-id', 'client-secret', 'your-username', 'your-password')
await redditClient.login()The client constructor has 3 params:
- The client id from your app in reddit apps. (https://www.reddit.com/prefs/apps)
- The client secret from your app in reddit apps. (https://www.reddit.com/prefs/apps)
- The username
- The password
- Debug mode (default: false): It's a switch to open debug console logs.
Note: After this the client is ready to use. Do not forget to login first.
| Method | Description | Parameters |
|---|---|---|
login() |
Logs in using the provided client credentials and Reddit username/password. | None |
getHomeFeed |
Fetches the home feed for the logged-in user. | limit (default: 10), sort (default: 'best', options: 'best', 'hot', 'new') |
getSubredditFeed |
Fetches posts from a specific subreddit with optional sorting. | subreddit (required), limit (default: 10), sort (default: 'hot', options: 'hot', 'top', 'new', 'controversial') |
getUserProfile |
Fetches the logged-in user's Reddit profile information. | None |
parseFeedItem |
Static method that normalizes and extracts information from a feed item. | item (Reddit API post object) |
Use at your own discretion. Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
For any questions or feedback about the project, please contact us through GitHub or emir@akatron.net
If you would like to contribute, please feel free to submit a pull request. We welcome any contributions!
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.
