1.0.29 • Published 2 years ago
skelly-app v1.0.29
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
2 years ago
1.0.28
2 years ago
1.0.27
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago