leash-sdk (Rust)
Rust SDK for Leash-hosted integrations.
Use it to call provider actions through the Leash platform proxy instead of handling provider OAuth and token storage yourself.
Installation
[]
= "0.2"
= { = "1", = ["full"] }
Quick Start
use LeashIntegrations;
async
Default Platform URL
https://leash.build
Features
- Gmail
- Google Calendar
- Google Drive
- connection status lookup
- connect URL generation
- generic provider calls
- custom integration calls
- app env fetch and caching
- MCP execution through the platform
Server Auth
The SDK includes framework-agnostic helpers for authenticating users on the
server side by reading the leash-auth cookie set by the Leash platform.
use ;
// In any handler that has access to the raw Cookie header:
let user = get_leash_user?;
println!;
// Or just check authentication:
if is_authenticated
If your framework has already parsed cookies, use the token directly:
let user = get_leash_user_from_cookie?;
MCP Calls
Execute MCP-backed tools through the platform:
let result = client.run_mcp.await?;
Notes
- pass a valid Leash platform JWT as the auth token
- use
with_api_key(...)for app-scoped access when needed - provider OAuth remains a platform concern, not an SDK concern
License
Apache-2.0