Avvio rapido dell'SDK
Slonge Billing offre tre pacchetti npm:
@slonge/cli— strumento a riga di comando@slonge/agent-sdk— SDK TypeScript per l'API HTTP@slonge/mcp-server— server MCP (stdio) per Claude Desktop / Cursor
Installazione
npm install -g @slonge/cli
Creare un token
- Nella dashboard vada in Impostazioni → Token API
- Clicchi su Nuovo token
- Copi il token (mostrato una sola volta)
Configurazione
export SLONGE_API_TOKEN=slk_...
export SLONGE_API_BASE_URL=https://app.slonge-billing.ch
Prima chiamata
slonge client list
slonge invoice send <id>
Consulti slonge --help per il riferimento completo.
Utilizzo programmatico dell'SDK
import { SdkClient, ClientResource } from '@slonge/agent-sdk';
const client = new SdkClient({
baseUrl: 'https://app.slonge-billing.ch',
apiToken: process.env.SLONGE_API_TOKEN!,
});
const clients = await new ClientResource(client).list();
MCP (Claude Desktop / Cursor)
In locale tramite stdio:
npm install -g @slonge/mcp-server
Poi in claude_desktop_config.json:
{
"mcpServers": {
"slonge-billing": {
"command": "slonge-mcp",
"env": {
"SLONGE_API_TOKEN": "slk_...",
"SLONGE_API_BASE_URL": "https://app.slonge-billing.ch"
}
}
}
}
Oppure ospitato tramite HTTP all'indirizzo https://app.slonge-billing.ch/api/mcp — se il suo client supporta i server MCP remoti.