Placet can act as an OAuth relay, allowing connected agents to initiate OAuth authorization flows that involve the end user — without the agent needing direct browser access. This is useful when an agent needs the user to authorize a third-party service (e.g., GitHub, Google, Slack) and the agent runs headlessly behind Placet.Documentation Index
Fetch the complete documentation index at: https://docs.placet.io/llms.txt
Use this file to discover all available pages before exploring further.
Supported Flows
Authorization Code + PKCE
The agent generates a PKCE challenge and constructs the authorization URL with Placet’s callback as theredirect_uri. The user clicks the link in the Placet UI, authorizes the app, and the OAuth provider redirects back to Placet. Placet then relays the authorization code to the agent via Socket.IO.
Security: The PKCE verifier never leaves the agent. Placet only sees the authorization code (which is useless without the verifier).
Device Code
The agent initiates a device code flow with the OAuth provider and sends the verification URL + user code to the user via Placet. The user opens the URL and enters the code. The agent polls the token endpoint directly.How It Works
Callback URL
The OAuth callback endpoint is:redirect_uri when constructing authorization URLs for the Authorization Code flow.
Socket.IO Events
oauth:start (agent → server)
Emitted by the agent to initiate an OAuth flow. The server registers the state for callback resolution and forwards the event to the user’s frontend.
| Field | Type | Required | Description |
|---|---|---|---|
channelId | string | Yes | The agent’s channel ID |
state | string | Yes | Unique state parameter for this flow |
provider | string | Yes | Name of the OAuth provider |
authUrl | string | No | Full authorization URL (Auth Code flow) |
deviceCode | object | No | Device code details (Device Code flow) |
deviceCode.verificationUri | string | Yes* | URL for the user to visit |
deviceCode.userCode | string | Yes* | Code for the user to enter |
deviceCode.expiresIn | number | No | Seconds until the device code expires |
oauth:code (server → agent)
Emitted to the agent’s channel when the OAuth callback receives an authorization code.
oauth:error (server → agent)
Emitted when the OAuth provider returns an error to the callback.
oauth:start (server → frontend)
Forwarded to the user’s frontend session to display the authorization link or device code.
State Management
- Each
oauth:startevent registers thestateparameter in an in-memory store with a 10-minute TTL. - The state is consumed (single-use) when the callback arrives.
- Expired or unknown states return an error page to the user.
