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

tako-sdk

v0.1.5

Published

JavaScript/TypeScript SDK for the Tako API

Downloads

90

Readme

Tako SDK

A lightweight TypeScript SDK for the Tako API.

Installation

npm install tako-sdk
# or
yarn add tako-sdk
# or
pnpm add tako-sdk

Quick Start

import { createTakoClient } from 'tako-sdk';

// Initialize the client
const tako = createTakoClient(process.env.TAKO_API_KEY!);

// Search Tako Knowledge
const results = await tako.knowledgeSearch('AMD vs. Nvidia headcount since 2015');
console.log(results.outputs.knowledge_cards);

Usage Example: Next.js API Route (App Router)

// app/api/tako-search/route.ts
import { createTakoClient } from 'tako-sdk';
import { NextResponse } from 'next/server';

export async function POST(request: Request) {
  const { query, sourceIndexes } = await request.json();
  const tako = createTakoClient(process.env.TAKO_API_KEY!);
  
  try {
    const results = await tako.knowledgeSearch(query, sourceIndexes);
    return NextResponse.json(results);
  } catch (error: any) {
    return NextResponse.json(
      { error: error.message || 'An error occurred' },
      { status: error.status || 500 }
    );
  }
}

API Reference

createTakoClient(apiKey)

Creates a new Tako API client.

const tako = createTakoClient('your-api-key');

Parameters:

  • apiKey (string): Your Tako API key

takoClient.knowledgeSearch(text, sourceIndexes?)

Search Tako Knowledge using natural language.

const results = await tako.knowledgeSearch('AMD vs. Nvidia headcount since 2015');

Parameters:

  • text (string): The natural language query text
  • sourceIndexes (SourceIndex[], optional): Array of source indexes to search within. Available values: SourceIndex.TAKO or SourceIndex.WEB

Returns: Promise<KnowledgeSearchResponse>

The response contains an array of knowledge cards in the outputs.knowledge_cards field. Each knowledge card contains:

  • card_id: Unique identifier for the card
  • title: Card title
  • description: Detailed description of the card's content
  • webpage_url: URL of a webpage hosting the interactive knowledge card
  • image_url: URL of a static image of the knowledge card
  • embed_url: URL of an embeddable iframe of the knowledge card
  • sources: The sources of the knowledge card
  • methodologies: The methodologies of the knowledge card

For detailed API response types and subfield structure, see the Tako API Documentation.

Error Handling

The SDK throws typed exceptions for different errors:

import { 
  TakoException,
  TakoUnauthorizedException,
  TakoRateLimitException,
} from 'tako-sdk';

try {
  const results = await tako.knowledgeSearch(query);
} catch (error) {
  if (error instanceof TakoUnauthorizedException) {
    console.error('Authentication error:', error.message);
  } else if (error instanceof TakoRateLimitException) {
    console.error('Rate limit exceeded:', error.message);
  } else if (error instanceof TakoNotFoundException) {
    console.error('Resource not found:', error.message);
  } else if (error instanceof TakoException) {
    console.error('API error:', error.message);
  } else {
    console.error('Unexpected error:', error);
  }
}

Each exception includes:

  • status: HTTP status code
  • message: Error message
  • details: Additional error details from the API (if available)