Démarrage rapide du SDK
Slonge Billing propose trois paquets npm :
@slonge/cli— outil en ligne de commande@slonge/agent-sdk— SDK TypeScript pour l'API HTTP@slonge/mcp-server— serveur MCP (stdio) pour Claude Desktop / Cursor
Installation
npm install -g @slonge/cli
Créer un jeton
- Dans le tableau de bord, allez dans Paramètres → Jetons d'API
- Cliquez sur Nouveau jeton
- Copiez le jeton (affiché une seule fois)
Configuration
export SLONGE_API_TOKEN=slk_...
export SLONGE_API_BASE_URL=https://app.slonge-billing.ch
Premier appel
slonge client list
slonge invoice send <id>
Consultez slonge --help pour la référence complète.
Utilisation programmatique du 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)
En local via stdio :
npm install -g @slonge/mcp-server
Puis dans claude_desktop_config.json :
{
"mcpServers": {
"slonge-billing": {
"command": "slonge-mcp",
"env": {
"SLONGE_API_TOKEN": "slk_...",
"SLONGE_API_BASE_URL": "https://app.slonge-billing.ch"
}
}
}
}
Ou hébergé via HTTP à l'adresse https://app.slonge-billing.ch/api/mcp — si votre client prend en charge les serveurs MCP distants.