skelly-app
TypeScript icon, indicating that this package has built-in type declarations

1.0.29 • Public • Published

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)

Package Sidebar

Install

npm i skelly-app

Homepage

skelly.gg

Weekly Downloads

2

Version

1.0.29

License

ISC

Unpacked Size

35.3 kB

Total Files

21

Last publish

Collaborators

  • skelly-app