1.0.29 • Published 6 months ago

skelly-app v1.0.29

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

skelly-app

Library allowing your to easily integrate your services with Skelly.

Installation

Installing the package using npm:

npm install skelly-app

Installing the repository using git and launching the demo react app:

git clone https://github.com/Skelly-gg/skelly-app.git

cd skelly-app

npm install

npm run demo

start .\dist\index.html

You can also play with the online demo.

Integration

GraphQL

Here is how you can fetch profiles using GraphQL:

import { getProfile, getProfiles } from "skelly-app";

const profile = await getProfile("N0tail");
console.log(profile)

const profiles = await getProfiles(["Keria", "12728"])
console.log(profiles)

React

You can also easily integrate profiles into your React application using our out-of-the-box component:

import {Profile} from "skelly-app";

export function App() {
  const { fetchProfile, accountId, loadingProfile, profile, errorProfile } =
    useFetchProfile();

  React.useEffect(() => {
    fetchProfile("S1mple");
  }, []);

  if (profile) return <Profile profile={profile} />;
  else return <div>Loading profile...</div>;
}

Utilities

There are convenient utility functions available to process Skelly profiles:

import { getProfile, getAvatar, getName, getLongName } from "skelly-app";

const profile = await getProfile("N0tail");

const avatarURL = getAvatar(profile)
console.log(avatarURL)

const name = getName(profile)
console.log(name)

const longName = getLongName(profile)
console.log(longName)
1.0.29

6 months ago

1.0.28

8 months ago

1.0.27

9 months ago

1.0.26

9 months ago

1.0.25

9 months ago

1.0.24

9 months ago

1.0.23

9 months ago

1.0.22

9 months ago

1.0.21

9 months ago

1.0.20

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago