@zipph/ai-toolkit
v0.0.5
Published
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).
Maintainers
Readme
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-toolkitQuick 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_KEYCustom 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
