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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@akabot/agentic-sdk

v0.1.0

Published

TypeScript SDK for building integrations with the akabot 2.0 Agentic AI Platform, featuring flexible authentication, resource APIs, and developer-friendly abstractions for automation workflows.

Readme

Agentic SDK

TypeScript SDK for building integrations with the akaBot 2.0 Agentic AI Platform, featuring flexible authentication, resource APIs, and developer-friendly abstractions for automation workflows.

License: Apache-2.0 TypeScript Node.js

Features

  • 🔐 Flexible Authentication - Multiple auth providers (API Key, Environment, File, Static)
  • 📦 Resource Management - Built-in support for Assets and Files
  • 🎯 Type-Safe - Full TypeScript support with comprehensive type definitions
  • 🔄 Modern Architecture - ESM and CJS support with tree-shaking
  • Performance - Lazy initialization and efficient HTTP client
  • 🛡️ Error Handling - Comprehensive error types with detailed messages
  • 🧪 Well-Tested - Extensive test coverage with Vitest
  • 📝 Developer-Friendly - Intuitive API with JSDoc documentation

Installation

npm install @akabot/agentic-sdk
yarn add @akabot/agentic-sdk
pnpm add @akabot/agentic-sdk

Quick Start

Basic Usage

import { AgenticClient } from '@akabot/agentic-sdk';

// Create a client with default configuration
const client = new AgenticClient();

// Use the client
const assets = await client.asset.findAll();
console.log(assets);

Using Environment Variables

import { AgenticClient, EnvironmentAuthProvider } from '@akabot/agentic-sdk';

// Reads API key from environment variable
const client = new AgenticClient({
  authProvider: new EnvironmentAuthProvider({
    apiKeyEnvVar: 'MY_API_KEY',
  }),
});

Using Default Authentication

import { AgenticClient } from '@akabot/agentic-sdk';

// Uses DefaultAuthProvider with fallback chain:
// 1. Environment variable (AGENTIC_API_KEY)
// 2. Config file (.agentic/config.json)
// 3. Throws error if not found
const client = new AgenticClient();

Authentication

The SDK supports multiple authentication strategies through the AuthProvider interface.

Available Auth Providers

1. StaticAuthProvider

Use a pre-configured Auth instance:

import { AgenticClient, ApiKeyAuth, StaticAuthProvider } from '@akabot/agentic-sdk';

const auth = new ApiKeyAuth('your-api-key');
const client = new AgenticClient({
  authProvider: new StaticAuthProvider(auth),
});

2. EnvironmentAuthProvider

Load API key from environment variables:

import { EnvironmentAuthProvider } from '@akabot/agentic-sdk';

const provider = new EnvironmentAuthProvider({
  apiKeyEnvVar: 'MY_API_KEY', // defaults to 'AGENTIC_API_KEY'
});

3. FileAuthProvider

Load credentials from a JSON file:

import { FileAuthProvider } from '@akabot/agentic-sdk';

const provider = new FileAuthProvider({
  path: './config/credentials.json',
});

// credentials.json format:
// {
//   "apiKey": "your-api-key"
// }

4. DefaultAuthProvider

Tries multiple sources in order:

import { DefaultAuthProvider } from '@akabot/agentic-sdk';

const provider = new DefaultAuthProvider({
  envVar: 'AGENTIC_API_KEY', // Optional: custom env var name
  configPath: '.agentic/config.json', // Optional: custom config path
});

API Reference

AgenticClient

The main entry point for the SDK.

interface AgenticClientOptions {
  baseURL?: string; // API base URL
  authProvider?: AuthProvider; // Authentication provider
  timeout?: number; // Request timeout in milliseconds
}

Resources

The SDK provides the following resource clients:

Asset Resource

Manage assets with full CRUD operations:

  • create() - Create a new asset
  • findAll() - Find all assets with pagination
  • search() - Search assets by term
  • filterAll() - Filter assets by criteria
  • findOne() - Find a single asset by name
  • update() - Update an existing asset
  • remove() - Delete an asset

Example:

const asset = await client.asset.create({
  name: 'my-asset',
  value: 'asset-value',
  type: AssetType.TEXT,
  scope: 'global',
});

const pagedAssets = await client.asset.findAll({ page: 1, limit: 10 });

File Resource

Handle file uploads and downloads with presigned URLs:

  • create() - Create and upload a file
  • getFile() - Get file metadata
  • getDownloadLink() - Get presigned download URL
  • delete() - Delete a file

Example:

// Node.js
const file = await client.file.create({
  file: fileBuffer,
  originalName: 'document.pdf',
});

// Browser
const file = await client.file.create({
  file: inputFile.files[0],
});

const downloadUrl = await client.file.getDownloadLink('file-id');

Error Handling

The SDK provides comprehensive error types for different scenarios:

import { ResourceNotFoundError, UnauthorizedError } from '@akabot/agentic-sdk';

try {
  const asset = await client.asset.findOne('non-existent');
} catch (error) {
  if (error instanceof ResourceNotFoundError) {
    console.error('Asset not found');
  } else if (error instanceof UnauthorizedError) {
    console.error('Authentication failed');
  }
}

Available error types: SdkError, ResourceNotFoundError, InvalidRequestError, UnauthorizedError, ForbiddenError, ConflictError, RateLimitError, ServerError, NetworkError, UnexpectedError

Development

# Install dependencies
npm install

# Run tests
npm test

# Build the SDK
npm run build

# Lint code
npm run lint

License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details.