Skip to main content

Usage

Sanvex follows one pattern everywhere: resolve a driver, pick a resource, call an action.

Basic pattern

Each driver exposes resources as methods on the driver instance:

Check configuration

Before calling a driver, verify credentials are stored:

Multi-tenancy

Scope credentials and driver instances to an owner:
See Tenancy.

Local database access

Some drivers cache entities in sv_entities. Access them via db():
Note: DB resource queries filter by driver and entity_type but not by owner in the base implementation.

Webhooks

Sanvex registers POST /sanvex/webhook for incoming webhook payloads. Drivers implement handleWebhook() and verifySignature().

Agent integration

Expose Sanvex to AI agents through:
  • Laravel AISanvexAi tools for Laravel AI SDK agents
  • MCP — stdio or HTTP SSE server for MCP clients

Discover available operations

For MCP clients, use the sanvex_list_operations tool after starting php artisan sanvex:mcp-stdio.

Next steps