universal-social-sdk 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.test.example +46 -0
- package/CHANGELOG.md +47 -0
- package/README.md +17 -0
- package/examples/bluesky-post.mjs +14 -0
- package/examples/instagram-reel.mjs +15 -0
- package/examples/x-post.mjs +14 -0
- package/package.json +16 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copy this file to .env.test and fill only sandbox credentials.
|
|
2
|
+
# Tests load .env.test first, then .env as fallback.
|
|
3
|
+
|
|
4
|
+
# X
|
|
5
|
+
X_API_KEY=
|
|
6
|
+
X_API_SECRET=
|
|
7
|
+
X_ACCESS_TOKEN=
|
|
8
|
+
X_ACCESS_SECRET=
|
|
9
|
+
X_TEST_TWEET_ID=
|
|
10
|
+
|
|
11
|
+
# Facebook
|
|
12
|
+
FB_PAGE_ACCESS_TOKEN=
|
|
13
|
+
FB_PAGE_ID=
|
|
14
|
+
|
|
15
|
+
# Instagram
|
|
16
|
+
IG_ACCESS_TOKEN=
|
|
17
|
+
IG_USER_ID=
|
|
18
|
+
|
|
19
|
+
# LinkedIn
|
|
20
|
+
LINKEDIN_ACCESS_TOKEN=
|
|
21
|
+
LINKEDIN_ORG_URN=
|
|
22
|
+
|
|
23
|
+
# YouTube
|
|
24
|
+
YOUTUBE_ACCESS_TOKEN=
|
|
25
|
+
YOUTUBE_CHANNEL_ID=
|
|
26
|
+
|
|
27
|
+
# TikTok
|
|
28
|
+
TIKTOK_ACCESS_TOKEN=
|
|
29
|
+
|
|
30
|
+
# Pinterest
|
|
31
|
+
PINTEREST_ACCESS_TOKEN=
|
|
32
|
+
PINTEREST_BOARD_ID=
|
|
33
|
+
|
|
34
|
+
# Bluesky
|
|
35
|
+
BLUESKY_IDENTIFIER=
|
|
36
|
+
BLUESKY_APP_PASSWORD=
|
|
37
|
+
BLUESKY_TEST_ACTOR=
|
|
38
|
+
|
|
39
|
+
# Mastodon
|
|
40
|
+
MASTODON_BASE_URL=
|
|
41
|
+
MASTODON_ACCESS_TOKEN=
|
|
42
|
+
MASTODON_ACCOUNT_ID=
|
|
43
|
+
|
|
44
|
+
# Threads
|
|
45
|
+
THREADS_ACCESS_TOKEN=
|
|
46
|
+
THREADS_USER_ID=
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.1] - 2026-03-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Runtime validation for public platform methods.
|
|
15
|
+
- Integration test scaffolding for all supported platforms.
|
|
16
|
+
- Repository governance files (`CODE_OF_CONDUCT.md`, `SECURITY.md`, `LICENSE`).
|
|
17
|
+
- Examples folder with runnable scripts.
|
|
18
|
+
- Package metadata fields (`homepage`, `bugs`, `funding`) in `package.json`.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- CI and release workflow gating behavior for clearer run outcomes.
|
|
23
|
+
- Documentation coverage for platform matrix, testing, and project structure.
|
|
24
|
+
|
|
25
|
+
## [1.0.0] - 2026-03-08
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Initial public release of `universal-social-sdk`.
|
|
30
|
+
- Unified static async APIs for:
|
|
31
|
+
- X
|
|
32
|
+
- Facebook
|
|
33
|
+
- Instagram
|
|
34
|
+
- LinkedIn
|
|
35
|
+
- YouTube
|
|
36
|
+
- TikTok
|
|
37
|
+
- Pinterest
|
|
38
|
+
- Bluesky
|
|
39
|
+
- Mastodon
|
|
40
|
+
- Threads
|
|
41
|
+
- CLI:
|
|
42
|
+
- `universal-social-sdk init`
|
|
43
|
+
- `universal-social-sdk update`
|
|
44
|
+
- Build + type declarations via TypeScript + tsup.
|
|
45
|
+
- Unit and integration test scaffolding.
|
|
46
|
+
- GitHub Actions CI and npm release automation.
|
|
47
|
+
- Comprehensive setup and usage documentation.
|
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ TypeScript-first, ESM-only, zero-bloat Node.js SDK that provides one unified int
|
|
|
12
12
|
- [Contributing](./docs/CONTRIBUTING.md)
|
|
13
13
|
- [Code of Conduct](./CODE_OF_CONDUCT.md)
|
|
14
14
|
- [Security Policy](./SECURITY.md)
|
|
15
|
+
- [Changelog](./CHANGELOG.md)
|
|
15
16
|
|
|
16
17
|
## Install
|
|
17
18
|
|
|
@@ -46,6 +47,22 @@ await Mastodon.createStatus({ text: "Hello Fediverse!" });
|
|
|
46
47
|
await Threads.postText({ text: "Hello Threads!" });
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
Run bundled examples:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run example:x
|
|
56
|
+
npm run example:instagram
|
|
57
|
+
npm run example:bluesky
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Files:
|
|
61
|
+
|
|
62
|
+
- `examples/x-post.mjs`
|
|
63
|
+
- `examples/instagram-reel.mjs`
|
|
64
|
+
- `examples/bluesky-post.mjs`
|
|
65
|
+
|
|
49
66
|
## Required Environment Variables
|
|
50
67
|
|
|
51
68
|
`universal-social-sdk` auto-loads `.env` with `dotenv`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Bluesky } from "universal-social-sdk";
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const result = await Bluesky.postText({
|
|
5
|
+
text: "Hello from universal-social-sdk Bluesky example!"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
console.log("Bluesky post result:", result);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
main().catch((error) => {
|
|
12
|
+
console.error("Failed to create Bluesky post:", error);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Instagram } from "universal-social-sdk";
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const result = await Instagram.uploadReel({
|
|
5
|
+
videoUrl: "https://example.com/reel.mp4",
|
|
6
|
+
caption: "Hello from universal-social-sdk reel example!"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
console.log("Instagram reel result:", result);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
main().catch((error) => {
|
|
13
|
+
console.error("Failed to publish reel:", error);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { X } from "universal-social-sdk";
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
const result = await X.postTweet({
|
|
5
|
+
text: "Hello from universal-social-sdk example!"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
console.log("Tweet result:", result);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
main().catch((error) => {
|
|
12
|
+
console.error("Failed to post tweet:", error);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-social-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "TypeScript-first universal social media SDK for Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/Gabo-Tech/universal-social-sdk.git"
|
|
11
11
|
},
|
|
12
|
+
"homepage": "https://github.com/Gabo-Tech/universal-social-sdk#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Gabo-Tech/universal-social-sdk/issues"
|
|
15
|
+
},
|
|
16
|
+
"funding": {
|
|
17
|
+
"type": "github",
|
|
18
|
+
"url": "https://github.com/sponsors/Gabo-Tech"
|
|
19
|
+
},
|
|
12
20
|
"keywords": [
|
|
13
21
|
"sdk",
|
|
14
22
|
"social-media",
|
|
@@ -35,7 +43,10 @@
|
|
|
35
43
|
"files": [
|
|
36
44
|
"dist",
|
|
37
45
|
"README.md",
|
|
46
|
+
"CHANGELOG.md",
|
|
38
47
|
".env.example",
|
|
48
|
+
".env.test.example",
|
|
49
|
+
"examples",
|
|
39
50
|
"supported-methods.json"
|
|
40
51
|
],
|
|
41
52
|
"bin": {
|
|
@@ -49,6 +60,9 @@
|
|
|
49
60
|
"test": "vitest run",
|
|
50
61
|
"test:unit": "vitest run tests/unit",
|
|
51
62
|
"test:integration": "vitest run tests/integration",
|
|
63
|
+
"example:x": "node examples/x-post.mjs",
|
|
64
|
+
"example:instagram": "node examples/instagram-reel.mjs",
|
|
65
|
+
"example:bluesky": "node examples/bluesky-post.mjs",
|
|
52
66
|
"test:watch": "vitest",
|
|
53
67
|
"prepare": "npm run build"
|
|
54
68
|
},
|
|
@@ -57,7 +71,7 @@
|
|
|
57
71
|
"chalk": "^5.4.1",
|
|
58
72
|
"cheerio": "^1.0.0",
|
|
59
73
|
"commander": "^13.1.0",
|
|
60
|
-
"diff": "^
|
|
74
|
+
"diff": "^8.0.3",
|
|
61
75
|
"dotenv": "^16.4.7",
|
|
62
76
|
"facebook-nodejs-business-sdk": "^24.0.1",
|
|
63
77
|
"inquirer": "^13.3.0",
|