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

wetrocloud-sdk

v3.0.0

Published

A lightweight SDK for interacting with the WetroCloud API

Readme

WetroCloud SDK

Introduction

The WetroCloud SDK provides an easy way to interact with the WetroCloud API, allowing developers to create collections, insert resources, and query data effortlessly.

Installation


npm install wetrocloud-sdk

Usage

Importing the SDK

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud({ apiKey: "your-api-key" });

Available Methods

1. createCollection()

Creates a new collection.

Parameters:

  • collection_id: string - (Optional) The unique ID of the collection.

Return Type:

Promise<ICreateCollection | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

const collection_id = 'unique_id'; //this is optional if not specified one would be generated for you.
const response = await wetrocloud.createCollection({ collection_id });

console.log("Creating Collection", response);

2. listCollections()

Retrieves a list of available collections.

Return Type:

Promise<IListCollection[] | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";
 
const wetrocloud = new Wetrocloud();
const response = await wetrocloud.listCollections();

console.log("Lisiting Collections", response);

3. insertResource()

Inserts a resource into a collection.

Parameters:

  • collection_id: string - The ID of the collection.

  • resource: string - The resource to insert.

  • type: string - The type of resource.

Return Type:

Promise<IInsertResourceCollection | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();
const response = await wetrocloud.insertResource({
  collection_id: "<collection_id>",
  resource: "https://medium.com/@AlexanderObregon/a-brief-history-of-artificial-intelligence-1656693721f9#:~:text=In%20this%20article%2C%20we%20explore,learning%20are%20breaking%20new%20ground.",
  type: "web"
});

console.log("insert a resource", response);

4. queryCollection<T>()

Queries resources from a collection.

Parameters:

  • collection_id: string - The ID of the collection.

  • request_query: string - The query string.

  • json_schema?: T | T[] - Optional JSON schema.

  • json_schema_rules?: string - Optional JSON schema rules.

  • model?: string - Optional model parameter.

  • stream?: boolean - Optional. Determines whether the response should be streamed. Defaults to false.

Return Type:

Promise<IErrorMessage | IQueryResourceCollectionDynamic<T>>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

const collectionId = '<collection_id>';
const query = 'What are the sales trends for Q1?';

const response = await wetrocloud.queryCollection({
  collection_id: collectionId,
  request_query: query,
});

console.log("Querying resource", response);

5. chat<T>()

Chat with a collection using message history.

Parameters:

  • collection_id: string - The ID of the collection.

  • message: string - The message to send.

  • chat_history: { "role": "user" | "system", "content": string }[] - Chat history.

  • stream?: boolean - Optional. Determines whether the response should be streamed. Defaults to false.

Return Type:

Promise<IErrorMessage | IQueryResourceCollectionDynamic<T>>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();
const response = await wetrocloud.chat({
 collection_id:"<collection_id>",
 message:"Tell me more",
 chat_history:[
    {"role":"user", "content":"What is this all about?"}, 
    {"role":"system","content":"This is about Queen Elizabeth_II of England"}
 ]
});

console.log("Chat with collection", response);

6. deleteResource()

Deletes a resource from a collection.

Parameters:

  • collection_id: string - The ID of the collection.

  • resource_id: string - The ID of the resource to delete.

Return Type:

Promise<IGenericResponse | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();
const response = await wetrocloud.deleteResource({
  collection_id: '<collection_id>',
  resource_id: '<resource_id>'
});

console.log("Deleting resource", response);

7. deleteCollection()

Deletes an entire collection.

Parameters:

  • collection_id: string - The ID of the collection.

Return Type:

Promise<IGenericResponse | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();
const response = await wetrocloud.deleteCollection({
  collection_id:'<collection_id>',
});

console.log("Deleting collection", response);

8. categorize<T>()

Categorizes a resource using predefined categories.

Parameters:

  • resource: string - The resource to categorize.

  • type: string - The type of resource.

  • json_schema: T | T[] - JSON schema of the resource.

  • categories: string[] - List of categories.

  • prompt: string - An overall command of your request.

Return Type:

Promise<ICatergorizeResource<T> | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

//Categorize content
const response = await wetrocloud.categorize({
    resource: "match review: John Cena vs. The Rock",
    type: "text",
    json_schema: { 'label': '' },
    categories: ["football", "coding", "entertainment", "basketball", "wrestling", "information"],
    prompt: "Where does this fall under?"
  });

  console.log("Categorizing resource", result);

9. textGeneration()

Generates text without retrieval-augmented generation (RAG).

Parameters:

  • model: string - The model to use.

  • messages: { role: "user" | "system" | "assistant", content: string }[] - Message history.

  • stream?: boolean - Optional. Determines whether the response should be streamed. Defaults to false.

Return Type:

Promise<IGenericResponse | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

// Text Generation
const response = await wetrocloud.textGeneration({
  messages: [
      {"role": "system", "content": "You are a helpful assistant."}, 
      {"role": "user", "content": "Write a short poem about technology."}
  ],
  model: "llama-3.3-70b"
})

console.log("Generation without RAG", result);

10. imageToText()

Extracts text from an image.

Parameters:

  • image_url: string - The URL of the image.

  • request_query: string - The query to process the image.

Return Type:

Promise<IGenericResponse | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

const imageUrl = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQBQcwHfud1w3RN25Wgys6Btt_Y-4mPrD2kg&s';
const query = 'What animal is this?';

// Extract text from an image and answer questions about it
const response = await wetrocloud.imageToText({
  image_url: imageUrl,
  request_query: query
})

console.log("Image to text", response);

11. extract<T>()

Extracts structured data from a website.

Parameters:

  • website_url: string - The URL of the website.

  • json_schema: T | T[] - The JSON schema defining the expected structure.

Return Type:

Promise<IDataExtraction<T> | IErrorMessage>;

Example:

import Wetrocloud from "wetrocloud-sdk";

const wetrocloud = new Wetrocloud();

const website = "https://www.forbes.com/real-time-billionaires/#7583ee253d78"
const json_schema = [{ "name": "<name of rich man>", "networth": "<amount worth>" }]

// Extract structured data from a website
const response = await wetrocloud.extract({
   website,
  json_schema:
});

console.log("Data extraction", result);

Here are the markdown-formatted documentation sections for both markDownConverter() and transcript() methods, following the format of your extract<T>() example:


12. markDownConverter()

Converts a markdown resource (URL or local file) into structured markdown content using WetroCloud.

Parameters:

  • resource: string – The markdown file path or URL.
  • resource_type: string – Type of resource, e.g., "file" or "web".

Return Type:

Promise<IMarkDown>

Example:

import Wetrocloud from "wetro-sdk";

const wetrocloud = new Wetrocloud();

const resource = "https://www.forbes.com/real-time-billionaires/#7583ee253d78"; 
const resource_type = "web";

// Convert markdown file to structured markdown
const result = await wetrocloud.markDownConverter({
  resource,
  resource_type
});

console.log("Converted Markdown", result);

13. transcript()

Retrieves transcript data from a YouTube video via WetroCloud.

Parameters:

  • resource: string – The YouTube video URL.
  • resource_type: 'youtube' – Must be set to "youtube".

Return Type:

Promise<ITrancript>

Example:

import Wetrocloud from "wetro-sdk";

const wetrocloud = new Wetrocloud();

const resource = "https://www.youtube.com/watch?v=m4qBwGnubew&pp=ygURZ29vZ2xlIGFpIHJlbGVhc2U%3D";
const resource_type = "youtube";

// Retrieve transcript from YouTube video
const result = await wetrocloud.transcript({
  resource,
  resource_type
});

console.log("Transcript result", result);

Let me know if you want these grouped in a table of contents or need this output styled for a README or documentation website.

Support

For additional support, please contact [email protected] or visit our website WetroCloud Docs.