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 🙏

© 2026 – Pkg Stats / Ryan Hefner

verstka-js-sdk

v0.0.11

Published

## Installation ```bash npm i verstka-js-sdk ```

Readme

Verstka JavaScript SDK

Installation

npm i verstka-js-sdk

Usage

Creating SDK instance

SDK instance is created once. It allows to open and close multiple editor windows. To create the instance you will need:

  • apiKey – your API-key
  • imagesOrigin – the domain from which your images are served
  • dev — ability to connect to the our dev server, false bu default

You can also set verbose: true for explicit logs, which is false by default.

import VerstkaSDK from 'verstka-js-sdk'

const sdk = new VerstkaSDK({
  apiKey: 'fd07ff6ed5954c9675578c96b4cdf39d',
  imagesOrigin: 'https://domain.com',
  verbose: true,
  dev: true,
})

Opening editor window

Call openEditor to open editor window:

  • userId – ID of current user. Verstka doesn't use this ID. You can "hardcode" it if you don't need it either.
  • materialID – ID of current article. Verstka uses it for version history.
  • target – allows you to edit desktop or mobile (or whatever) versions at the same time. It's desktop by default.
  • html – artcile HTML. It's supposed to be empty when new article is created. When the article is edited, it contains the HTML of the previous version.
  • customFields – JSON with arbitrary data. You will get back when the article is saved. Empty by default.
const session = await sdk.openEditor({
  userId: '42',
  materialId: '69',
  target: 'desktop',
  html: '',
  customFields: {},
})

Combination of userId, materialID and target forms a unique key. If session with this key already exists then openEditor will return it.

Closing editor window

Open window can be closed by calling close method:

session.close()

Editor window can also be closed manually by the user. In both cases event closed will be emitted.

Saving article

Created session inherits EventEmitter interface. Event saved is emmited everytime the user saves the article in the editor window:

/**
 * Contains your code which handles article saving
 * 
 * @param {Object} data
 * @param {String} data.html – article HTML
 * @param {Blob[]} data.images – list of images as Blobs
 * @param {Object} data.customFields
 * @param {String} data.userId
 * @param {String} data.materialId
 * @param {String} data.target
 * 
 * @returns {void}
 */
function onSave({ html, images, customFields, userId, materialId, target }) {
  //...
}

session.on('saved', onSave)

Event closed is emitted whenever editor window is closed:

/**
 * Contains your code which handles article closing
 * 
 * @param {Object} data
 * @param {String} data.userId
 * @param {String} data.materialId
 * @param {String} data.target
 * 
 * @returns {void}
 */
function onClose({ html, images, customFields, userId, materialId, target }) {
  //...
}

session.on('closed', onClose)

Peer deps

  • axios ^0.24.0