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

@kolverse/sdk

v1.0.13

Published

This SDK provides functions to interact with KOLVerse.

Downloads

10

Readme

KOLVerse SDK

This SDK provides functions to interact with KOLVerse.

Installation

To install the SDK, use npm or yarn:

npm install @kolverse/sdk

Be aware that the SDK may be provided as a private package in other NPM registries or using different package names.

Usage

Importing the SDK

import {
  connectToKolVerse,
  handleKolVerseCallback,
  Identity,
} from '@kolverse/sdk';

Functions

getKolsInSuperGuild

Retrieves the KOLs in a super guild.

Parameters:

  • guild: The super guild to retrieve KOLs from.

Returns:

  • Promise<Kol[]>: A promise that resolves to an array of KOLs.

Example:

const kols: Kol[] = await getKolsInSuperGuild('super-guild');
console.log(
  'KOLs:',
  kols.map(kol => `${kol.username} (${kol.invitationCode})`)
);

connectToKolVerse

Redirects the user to the KolVerse signup/signin flow with the provided invitation code and callbacks.

Parameters:

  • invitationCode (string): The invitation code.
  • successUrl (string): The URL to redirect to upon successful flow.
  • errorUrl (string): The URL to redirect to if there is an error.

Example:

connectToKolVerse('your-invitation-code', '/success', '/error');

handleKolVerseCallback

Handles the callback from the KolVerse authentication flow.

Returns:

  • Identity: An object containing the authenticated user's identity.

Throws:

  • AuthenticationFlowError: If there is an error.

Example:

try {
  const identity: Identity = handleKolVerseCallback();
  console.log('Authenticated user:', identity.id, identity.username);
} catch (error) {
  console.error('Authentication failed:', error);
}

activateGuild

Activates a guild for the authenticated user.

Parameters:

  • guild (string): The guild to activate.

deactivateGuild

Deactivates a guild for the authenticated user.

Parameters:

  • guild (string): The guild to activate.

Types

Identity

An interface representing the authenticated user's identity.

Properties:

  • id (string): Integration ID of the authenticated user.
  • username (string): Twitter username of the authenticated user.

Kol

KOL essential details.

Properties:

  • username (string): Username of the KOL.
  • profileImageUrl (string): Profile image URL of the KOL.
  • invitationCode (string): Invitation code of the KOL.

Errors

AuthenticationFlowError

An error thrown during the authentication flow.