https://github.com/redsolver/social-dac-library
https://github.com/redsolver/social-dac-library
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/redsolver/social-dac-library
- Owner: redsolver
- License: mit
- Created: 2021-05-02T18:53:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-09T14:57:12.000Z (almost 4 years ago)
- Last Synced: 2025-03-18T13:58:21.487Z (about 2 months ago)
- Language: TypeScript
- Size: 167 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Social DAC for MySky
Forked from `feed-dac-library`.
This DAC uses the https://github.com/SkynetHQ/skystandards data structures
## Usage
Using the library is very straightforward. In this section we'll show an example
of how a skapp could use the content record library and record user interactions.TODO Update example
```typescript
import { SkynetClient } from "skynet-js";
import { SocialDAC } from "social-dac-library";(async () => {
// create client
const client = new SkynetClient();// create Social DAC
const socialDAC = new SocialDAC();// load mysky
const mySky = await client.loadMySky("exampleskapp.hns");// load DACs
await mySky.loadDacs(socialDAC);// check login
const isLoggedIn = await mySky.checkLogin();
if (!isLoggedIn) {
// request login access
}// Follow a user
const res = await socialDAC.follow("USERIDUSERIDUSERIDUSERIDUSERIDUSERID")
console.log(`Success: ${res.success}`);
console.log(`Error (if unsuccessful): ${res.error}`);// Get the list of users a user is following
const followingList = await socialDAC.getFollowingForUser("USERIDUSERIDUSERIDUSERIDUSERIDUSERID")
console.log(followingList);
})();
```