npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ripslol-wrapper.js

v0.0.2

Published

A lightweight library for interacting with rips.lol's API

Downloads

3

Readme

ripslol-wrapper.js

A lightweight fully documented and typed package that makes it simple to interact with rips.lol's API

Installation and Import

npm install ripslol-wrapper.js
yarn add ripslol-wrapper.js
pnpm add ripslol-wrapper.js

ESM

import { Client } from "ripslol-wrapper.js";

CommonJS

const { Client } = require("ripslol-wrapper.js");

Usage

Creating an instance of the client and authenticating

import { Client, LoginDetails } from "ripslol-wrapper.js";
const client = new Client();

// Username + password authentication
const details: LoginDetails = {
    username: "username",
    password: "password",
};

// Email + password authentication
const details: LoginDetails = {
    email: "[email protected]",
    password: "password",
};

// Finally, log in!
client
    .login(auth)
    .then(() => {
        console.log("Successfully logged in");
        // Perform actions against the API
    })
    .catch((error) => {
        // Catch for any errors that occur on login
        console.log(error);
    });

Methods

This wrapper exposes most of the available endpoints, however creating, updating and deleting socials is not yet supported as is fetching the authenticated user's data

We can organise the methods into 7 main groups:

Free biolink methods

These methods will work for anyone regardless of if they have purchased premium or not

client.biolink.setLink("qpro");
client.biolink.setName("qPro");
client.biolink.setBio("an example bio");
client.biolink.setProfilePicture("{profile picture url}");
client.biolink.setBackgroundPicture("{background picture url}");

Premium biolink methods

These methods will allow you to modify settings that a premium user could do, however they will not be displayed on the site

client.biolink.setMP3("{mp3 song url}");
client.biolink.setMP4("{mp4 video url}");
client.biolink.setNameColour("#ff0000");
client.biolink.enableSparkles(true);
client.biolink.enableTypewriter(false);

Socials methods

These methods allow the user to create, update and delete their own socials.

client.socials.create(client.sites.Website, "https://rips.lol");
client.socials.update(100, "qpro");
client.socials.delete(10);

User methods

These methods allow you to alter your user settings - email address, username and password

client.user.setEmailAddress("[email protected]", "[email protected]");
client.user.setUsername("qpro");
client.user.setPassword("pass", "word");

Spotify methods

These methods allow you to modify the spotify component of your biolink: setting the track with its track id and the theme that the spotify card will use.

client.spotify.setTrackId("3DK6m7It6Pw857FcQftMds");
client.spotify.setTheme(1);

Discord methods

These methods allow you to modify the discord component of your biolink: setting your discord user id, whether to display your status (online, offline, dnd, idle) and whether to display your current activity

client.discord.setDiscordId("1021219681471840317");
client.discord.enableStatus(false);
client.discord.enableActivity(true);

Fetch methods

These methods allow you to fetch the logged-in user's data, a discord user's information, spotify usage and presence/activites and a biolink's socials and data

client.biolink.fetch("qpro").then(console.log);
client.user.fetch().then(console.log);
client.socials.fetch("qpro").then(console.log);
client.discord.fetch("1021219681471840317").then(console.log);