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

@yonote/js-sdk

v0.1.1

Published

Official Yonote SDK

Readme

Yonote SDK for JavaScript

Installation

npm install @yonote/js-sdk

Usage

Import and initialize a client using an integration token or an OAuth access token.

import { Client } from "@yonote/js-sdk"

// Initializing a client
const client = new Client({
  token: process.env.YONOTE_TOKEN,
  baseUrl: "http://myCustomDomain.ru" // optional
})

Make a request to any Yonote API endpoint.

;(async () => {
  const listUsersResponse = await client.users.list({});
})()

Each method returns a Promise which resolves the response.

console.log(listUsersResponse)
{
  "id": "fbc2fc3e-87f0-4eb0-8225-cdb24497ee55",
  "email": "[email protected]",
  "name": "user",
  "avatarUrl": "https://i.yonote.ru/avatar/43f4563d166c0a78adcce6dc5a6caccz/i.png?c=9E5CF7",
  "color": "#9E5CF7",
  "isAdmin": false,
  "isSuspended": false,
  "isViewer": false,
  "createdAt": "2025-07-07T15:24:33.167Z",
  "updatedAt": "2025-08-05T13:01:47.892Z",
  "deletedAt": null,
  "lastActiveAt": "2025-08-05T13:01:47.892Z",
  "language": "ru_RU",
  "flags": {
    "inviteSent": 1
  }
}

The endpoint parameters are grouped into two objects - data and pagination. You don't need to remember which parameters are contained in the path, request, or body.

const myPage = await client.documents.search_titles(
  {
    query: "my query",
    direction: "ASC",
    isPublished: true,
  },
  {
    offset: 0,
    limit: 2,
  },
)

Handling errors

If the API returns an unsuccessful response, the returned Promise rejects with a APIResponseError.

The error contains properties from the response, and the most helpful is code. You can compare code to the values in the APIErrorCode object to avoid misspelling error codes.

const { Client, APIErrorCode, APIError } = require("@yonote/js-sdk")

try {
  const client = new Client({ token: process.env.YONOTE_TOKEN })
  const myPage = await client.documents.get({
    id: "wrongId",
  })
} catch (error) {
  if (err instanceof APIError) {
    if (err.code === APIErrorCode.ResourceNotFound) {
      //
      // For example: There is no document with this id. Check the correctness of the id
      //
    } else {
      // Other error handling code
      console.error(err);
    }
  }
}

Client options

The Client supports the following options on initialization. These options are all keys in the single constructor parameter.

| Option | Default value | Type | Description | |-------------|-----------------------| ------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------| | token | undefined | string | Bearer token for authentication. | | baseUrl | "https://yonote.ru" | string | The root URL for sending API requests. This can be changed to test with a mock server. |

Requirements

This package supports the following minimum versions:

  • Runtime: node >= 18
  • Type definitions (optional): typescript >= 5.9

Earlier versions may still work, but we encourage people building new applications to upgrade to the current stable.