What this crate is
One connects your users' accounts on over a thousand platforms (Gmail, Slack, GitHub, Salesforce and the rest) and lets you call any of their actions through one API, with credentials, token refresh and routing handled for you.
withone is the client: authentication, connections, retries, webhooks and the operation every action runs through. Each platform's typed actions ship as their own crate, withone-<platform>, so you add only the platforms you call.
Install
The library is imported as one.
Quick start
- Create a secret key in the One dashboard and export it as
ONE_SECRET. - Connect an account in the dashboard and copy its connection key.
- Run an action on that connection:
use One;
use withone_gmail as gmail;
async
What the client does
- Typed actions. Each action takes exactly the fields it needs, required ones enforced when you build, and the client routes each field to the path, query, headers or body. A list sends its query key once per item and its header items joined by commas; an object query value is refused as
Error::InvalidInput. - Escape hatches. Turn an action into an operation with
into_operation()to merge extra body, query or header fields, set a retry schedule or hook errors. - Credentials.
One::newtakes a secret key,One::builder().access_token(..)acts on a user's OAuth grant, andOne::from_envreadsONE_SECRETorONE_ACCESS_TOKEN. - Webhooks. Verify and dispatch One's webhook deliveries with typed handlers per event.
Platforms
Every platform One supports is listed on withone.ai/knowledge, with its actions and how each behaves. Its crate is withone-<platform> on crates.io.
The same client is on npm as @withone/sdk.
License
MIT