# social-dac-library

> This library exposes a class that wraps the Social DAC, created and hosted by redsolver.

Latest version **0.2.3** (published 2021-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install social-dac-library
pnpm add social-dac-library
yarn add social-dac-library
bun add social-dac-library
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2021-05-09 |
| First published | 2021-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 44.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | redsolver |
| Maintainers | redsolver |

## Links

- npm: https://www.npmjs.com/package/social-dac-library
- Homepage: https://github.com/redsolver/social-dac-library
- Issues: https://github.com/redsolver/social-dac-library/issues
- npm.io page: https://npm.io/package/social-dac-library

## Dependencies (3)

- [post-me](https://npm.io/package/post-me.md) ^0.4.5
- [skynet-js](https://npm.io/package/skynet-js.md) ^4.0.3-beta
- [skynet-mysky-utils](https://npm.io/package/skynet-mysky-utils.md) ^0.1.2

## Recent versions

- 0.2.3 (latest) — 2021-05-09
- 0.2.2 — 2021-05-02
- 0.2.1 — 2021-05-02
- 0.2.0 — 2021-05-02

## 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);
})();
```

---
_Source: https://npm.io/package/social-dac-library · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
