@zipph/ai-toolkit

0.0.5 • Public • Published

Zip AI Toolkit - TypeScript

Connect AI frameworks to Zip Payment Services with minimal configuration. Compatible with OpenAI's Agent SDK, LangChain, Vercel's AI SDK, and Model Context Protocol (MCP).

Requirements

  • Node 18+

Installation

npm install @zipph/ai-toolkit

Quick Start

import {ZipAIToolkit} from '@zipph/ai-toolkit/langchain';

const zipAIToolkit = new ZipAIToolkit({
  secretKey: process.env.ZIP_SECRET_KEY!,
  configuration: {
    actions: {
      customers: {create: true},
      charges: {create: true},
    },
  },
});

// Get tools for your AI framework
const tools = zipAIToolkit.getTools();

Framework Integration

LangChain Example

import {AgentExecutor, createStructuredChatAgent} from 'langchain/agents';

const agent = await createStructuredChatAgent({
  llm,
  tools,
  prompt,
});

const agentExecutor = new AgentExecutor({
  agent,
  tools,
});

Model Context Protocol (MCP)

Quick Setup with npx

npx -y @zipph/mcp --tools=all --secret-key=YOUR_ZIP_SECRET_KEY

Custom MCP Server

import {ZipAIToolkit} from '@zipph/ai-toolkit/modelcontextprotocol';
import {StdioServerTransport} from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new ZipAIToolkit({
  secretKey: process.env.ZIP_SECRET_KEY!,
  configuration: {
    actions: {
      customers: {create: true},
      charges: {create: true},
      checkoutSessions: {create: true},
    },
  },
});

async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.error('Zip MCP Server running on stdio');
}

main().catch(console.error);

For more examples, see the /examples directory in the repository.

Configuration Options

The toolkit is configured by specifying which API actions are enabled:

const zipAIToolkit = new ZipAIToolkit({
  secretKey: process.env.ZIP_SECRET_KEY!,
  configuration: {
    actions: {
      customers: {
        create: true,
        read: true,
      },
      charges: {
        create: true,
        read: true,
      },
      // Add other API methods as needed
    },
  },
});

API Key

Your Zip secret key is available in your Zip Dashboard

Package Sidebar

Install

npm i @zipph/ai-toolkit

Weekly Downloads

13

Version

0.0.5

License

MIT

Unpacked Size

1.43 MB

Total Files

26

Last publish

Collaborators

  • donjerick