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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@noops-studio/react-app-sdk-jb

v1.0.2

Published

SDK for backend

Readme

API SDK Documentation

A TypeScript SDK for interacting with the API, providing easy access to authentication, posts, comments, follows, and feed functionality.

Installation

npm install @noops-studio/react-app-sdk-jb

Quick Start

import { ApiSDK } from '@noops-studio/react-app-sdk-jb';

// Initialize the SDK
const sdk = new ApiSDK('https://api.example.com');

// Login
await sdk.auth.login('username', 'password');

// Create a post
await sdk.posts.create('My First Post', 'Hello World!');

Features

The SDK provides access to the following API endpoints:

  • Authentication (login, signup)
  • Posts (create, read, update, delete)
  • Comments (create, read, update, delete)
  • Follows (follow/unfollow users)
  • Feed (user feed)

API Reference

Authentication

// Login
await sdk.auth.login(username: string, password: string, variant?: 'standard' | 'delayed' | 'allowDelayed');

// Sign up
await sdk.auth.signup(username: string, password: string, name: string, variant?: 'standard' | 'delayed' | 'allowDelayed');

Posts

// Fetch all posts
await sdk.posts.fetchAll(variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Fetch single post
await sdk.posts.fetchById(id: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Create post
await sdk.posts.create(title: string, body: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Update post
await sdk.posts.update(id: string, title: string, body: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Delete post
await sdk.posts.delete(id: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

Comments

// Fetch all comments
await sdk.comments.fetchAll(variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Fetch comments for a post
await sdk.comments.fetchByPostId(postId: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Create comment
await sdk.comments.create(postId: string, body: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Update comment
await sdk.comments.update(id: string, body: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Delete comment
await sdk.comments.delete(id: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

Follows

// Get followers
await sdk.follows.getFollowers(variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Get following
await sdk.follows.getFollowing(variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Follow user
await sdk.follows.follow(userId: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

// Unfollow user
await sdk.follows.unfollow(userId: string, variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

Feed

// Get user feed
await sdk.feed.fetchUserFeed(variant?: 'standard' | 'delayed' | 'allow' | 'allowDelayed');

Request Variants

All API methods support different variants that modify the behavior of the request:

  • standard: Default behavior
  • delayed: Adds artificial delay to the response
  • allow: Modified permission checking
  • allowDelayed: Combines delayed response with modified permissions

Error Handling

The SDK uses axios for HTTP requests and automatically handles error responses. All errors are transformed into Error objects with meaningful messages.

try {
  await sdk.posts.create('My Post', 'Content');
} catch (error) {
  console.error(error.message); // Will contain the error message from the API
}

Custom Headers

You can initialize the SDK with custom headers:

const sdk = new ApiSDK('https://api.example.com', {
  'Custom-Header': 'value'
});

Authentication Token

The SDK automatically manages the authentication token after login. The token is included in all subsequent requests.