widevin for Rust
Rust 1.85+ bindings for Devin/Cascade OAuth login, caller-controlled token
storage, model discovery, and streaming chat/tool events. This crate mirrors
the behavior of the TypeScript widevin package and uses Reqwest with Rustls.
Only use Devin/Cascade programmatic access when permitted by your organization and applicable terms.
Install
[]
= "0.2.1"
= "0.3"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick start
use StreamExt;
use ;
async
Store raw tokens. The devin-session-token$ prefix is added only at request
boundaries; an empty token is treated as absent. File token stores create
private 0600 files on Unix. ToolCallDelta.arguments may contain a
throttled parsed JSON snapshot; the final ToolCallEnd.arguments value is
authoritative.
Enterprise client metadata
If your Devin organization authorizes Cascade models by client identity, set
the approved fields in DevinProviderOptions. They are applied to model
discovery, JWT auth, and chat requests.
use ;
let provider = create_devin_provider;
The default remains the Windsurf-compatible identity. This option changes metadata only; it does not implement a different transport.
Run the full smoke-test example from the repository:
The example uses DEVIN_TOKEN, .devin-token, or the OAuth callback flow in
that order. Delete .devin-token to remove the cached local token; this does
not revoke the credential server-side.