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

@lehcode/soakp-client

v1.1.0

Published

A browser library for the OpenAI API for secure handling of your API key.

Readme

SOAKP Client

Introducing SoakpClient: A Browser-focused OpenAI Library for Seamless UI Integration

Are you a UI developer looking to enhance your web-based projects with powerful natural language processing capabilities? Look no further! SoakpClient is a TypeScript library specifically designed to overcome the limitations of using the original openai library in browser environments.

With SoakpClient, you can effortlessly integrate the OpenAI API into your user interfaces, providing engaging and interactive experiences for your users. By leveraging a local SOAKP server at https://localhost:3033/openai/<completions>, this library ensures secure communication with the OpenAI API, all while complying with browser security restrictions and OpenAI security guidelines. The SOAKP client library is a pure wrapper of forked openai library.

Key Features:

  • Seamlessly integrate the OpenAI API into browser applications.
  • Overcome limitations of using the original openai library in browsers.
  • Use custom generated JWT hardened by keyphrase for authentication, thus making OpenAI key to not being exposed or leave local environment.
  • Empowers UI developers to focus on building intuitive and engaging interfaces.
  • Enables the generation of text completions and chat-based interactions for UI applications.
  • Optimized for creating exceptional user experiences.

SoakpClient is made for UI developers who want to use the power of the OpenAI API in their web-based projects. Whether you're building chatbots, text generation tools, or interactive applications requiring natural language processing, this library provides an interface for making API requests, allowing you to focus on delivering remarkable UI interactions.

To get started, simply instantiate the SoakpClient class with the necessary JWT, model, API base URL, and optional Axios configuration. From there, use the intuitive makeRequest method to seamlessly interact with the OpenAI API, generating text completions or facilitating chat-based conversations. Enjoy streamlined API communication and unleash the full potential of your UI applications.

Take your web interfaces to new heights with SoakpClient - the browser-focused OpenAI library for UI developers. Embrace the power of natural language processing, delight your users, and create memorable user experiences with ease. Get started today and revolutionize your UI development workflow!

Usage

Included lightweight snowpack builder is included to allow fast testing and build with predefined configuration. Update JWT in public/index.html code (const token="...") with a real one obtained from SOAKP server. JWT is used instead of your public key in SOAKP client library. Please refer to SOAKP server documentation for more information.

public/index.html:

<script type="module">
    import { SoakpClient } from "soakp-client";

    console.log(SoakpClient);

    const token =
      "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzay1IV0dvc0diYWltcmlYZDJFc2xXd1QzQmxia0ZKRnNnV2hsbFMzUGl3TWx0Nk9hbTEiLCJpYXQiOjE2ODU4OTY1MTgsImV4cCI6MTY4NTk4MjkxOH0.IsTHj0_OO7_TiLG8YEL1p2bgJQRijiA3wfVYEa6d6Aw";
    const client = new SoakpClient(token, 'text-davinci-003',  'https://localhost:3033/openai', {rejectUnauthorized: false});

    console.log(client);

    client.makeRequest("completions", ["Say hi!"]).then((response) => {
      debugger;
      console.log(response);

      if (response.status === 200) {
        document.getElementsByClassName('response textarea')[0].value = JSON.stringify(response.data.data.response);
        debugger;
      }
    }, (error, ...args) => {
      debugger;
    });
  </script>