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

@unleash-tech/platform-sdk

v1.0.3

Published

SDK to the Unleash platform

Downloads

4

Readme

Unleash Platform APIs

Unleash Platform APIs enable customers to programmatically access some of the core functionalities of the Unleash platform. the API is currently limited only for performing search and AI question answering. On our roadmap we plan to expand the API to support complete management of wikis, go links, connections, assistants, etc…

For the API swagger documentation please refer to: https://api.unleash.wiki

In this document we cover some basic concepts of the API plus some guidelines on how to use our JS SDK.

Installation

npm install @unleash-tech/platform-sdk

Quick Start

the following simple code will perform a search on behalf of “myuser” using the default assistant

var unleash = require('@unleash-tech/platform-sdk')

var client = 
    new unleash.ApiClient({
        token:'<mytoken>',
        account:'[email protected]'
    });

var assistant = client.assistants.default;

var response = await assistant.search({
    query:'how to use go links',
    filters:{appId:['notion']}
})

Authentication

The Unleash Platform APIs are protected using Bearer Tokens. Tokens can be created by admin users only from the api keys page in the settings section of the Unleash console.

Api Tokens in Unleash are not bounded to a specific user but attached globally to the organization workspace. Hence, whenever invoking an API , a user account must also be specified explicitly via the ‘unleash-account’ header (or the ‘account’ field of ApiClientOptions in the SDK).

Errors

Every endpoint of the platform API returns a RequestId field in the body and header of the response. in case you encountered an unexpected error you could provide the Requestid value to our support team to further diagnose the root cause of the error. Errors in the API follows standardised REST errors format (RFC 7807)

Assistants

In order to perform a search or answer a question using AI an assistant must be chosen. You can either choose to use the default assistant (e.g. the search experience of Unleash own search page) or a specific assistant

var assistant = client.assistants.default;
var myAssistant = client.assistants.withId('<assistant id>')

To create an assistant that can be used via the API go to the assistants page on the unleash console and create a new general assistant

Proceed to configure the assistant behavior and data sources and save the changes

Upon saving the assistant id will be available in the url of the page, the last fragment

There are four main methods which an assistant expose:

  • search - returns the actual resources that matches a certain user query
  • answer - generate an ai answer for a user question
  • filters - return the set of supported filters for the assistant based on the actual data sources that it has access to
  • filterValues - return the set of filter values that are supported for a given filter (e.g. for the appId filter it will return values such as: ‘notion’, ‘confluence’, etc..)

for the full description of those endpoints contracts refer to the swagger api