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

@gentoro/sdk

v0.0.8

Published

Gentoro SDK for Typescript

Readme

Gentoro TypeScript SDK

Welcome to the Gentoro TypeScript SDK documentation. This guide will help you get started with integrating and using the SDK in your project.

Setup & Configuration

Supported Language Versions

This SDK is compatible with TypeScript >= 5.7.2.

Installation

To get started with the SDK, we recommend installing it using npm or yarn:

npm install @gentoro/sdk

or

yarn add @gentoro/sdk

Authentication

The Gentoro API uses an Access Token for authentication. This token must be provided to authenticate your requests to the API.

To obtain an API Key, register at Gentoro.

Setting the Access Token

When initializing the SDK, provide the configuration as follows:

const _config:SdkConfig = {
    apiKey: import.meta.env.VITE_GENTORO_API_KEY, // Your Gentoro API Key
    baseUrl: import.meta.env.VITE_GENTORO_BASE_URI, // Base Url where the Gentoro API is hosted
    authModBaseUrl: import.meta.env.VITE_GENTORO_AUTH_MOD_BASE_URI, // Base Url where the Gentoro Auth module UI is hosted
    provider: Providers.Openai, // The provider you want to use
};
const _gentoro:Gentoro = new Gentoro(_config);

Usage

Here's a basic example demonstrating how to authenticate and retrieve available tools:

import { Gentoro } from '@gentoro/sdk';
import * as dotenv from 'dotenv';

dotenv.config();

async function main() {
    // Initialize the Open AI client
    const _openai = new OpenAI.Client({
        apiKey: process.env['OPENAI_API_KEY'],
    });
    
    // Configure and Initialize Gentoro SDK
    const _config:SdkConfig = {
        apiKey: process.env['GENTORO_API_KEY'], // Your Gentoro API Key
        baseUrl: process.env['GENTORO_BASE_URI'], // Base Url where the Gentoro API is hosted
        authModBaseUrl: process.env['GENTORO_AUTH_MOD_BASE_URI'], // Base Url where the Gentoro Auth module UI is hosted
        provider: Providers.Openai, // The provider you want to use
    };
    const _gentoro:Gentoro = new Gentoro(_config);
    
    // Gather user inference content
    const _messages: ChatCompletionMessageParam[] = [{
        role: 'user',
        content: 'How many e-mails I currently have in my Gmail mailbox?',
    }];

    // Fetch tools from Gentoro.
    // Bridge UIDs are generated and captured at Gentoro's Studio.
    const _tools = await _gentoro.getTools(process.env['GENTORO_BRIDGE_UID'], _messages) as ChatCompletionTool[];

    // Invoke OpenAI API to generate completions, providing context (messages) and available tools
    let _completion:ChatCompletion  = await _client.chat.completions.create({
        messages: _messages,
        model: process.env['OPENAI_MODEL'], //gpt-4o-mini for example
        tools: _tools,
    });

    // Check if OpenAI requested tool_calls, if yes, delegates their execution to Gentoro, and capture the output
    _messages.push(... await _gentoro.runTools(_completion) as OpenAI.Chat.Completions.ChatCompletionMessageParam[])

    // Callback OpenAI with function call generated results
    _completion:ChatCompletion  = await _client.chat.completions.create({
        messages: _messages,
        model: process.env['OPENAI_MODEL'], //gpt-4o-mini for example
        tools: _tools,
    });

    // Print the completion    
    console.log(_completion.choices[0].message.content);
    // You have a total of 10 emails in your Gmail mailbox.
}

main();

Services

Methods

getTools(bridgeUid: string, messages: ChatCompletionMessageParam[]): Promise<ChatCompletionTool[]>

Fetches tools from a specific bridge (Bridge UIDs are captured from Gentoro's Studio).

const _messages: ChatCompletionMessageParam[] = ...;
const _tools = await _gentoro.getTools(process.env['GENTORO_BRIDGE_UID'], _messages) as ChatCompletionMessageParam[];

runTools(bridgeUid: string, completion: ChatCompletion): Promise

Analyzes the completion and runs the tools if any are requested. Returns pre-configured message with the tool_call message, and response.

const _completion:ChatCompletion  = await _client.chat.completions.create(...);
const _newMessages = await _gentoro.runTools(process.env['GENTORO_BRIDGE_UID'], _completion) as OpenAI.Chat.Completions.ChatCompletionMessageParam[];

Providers

A provider defines how SDK should handle and generate content.

export enum Providers {
    Openai,
    Anthropic,
    OpenaiAssistants,
    Vercel,
    Gentoro
}

License

This SDK is licensed under the Apache-2.0 License. See the LICENSE file for more details.