Skip to content

Commit 3e5ca36

Browse files
committed
docs(management): note that withAuth inherits the surrounding task context
1 parent 88a302a commit 3e5ca36

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/management/authentication.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ Any SDK call inside the callback uses the overridden config. Calls outside the c
181181

182182
The override is scoped via [AsyncLocalStorage](https://nodejs.org/api/async_context.html), so concurrent `auth.withAuth` calls (including overlapping calls inside `Promise.all` with different tokens) do not interfere. Nested calls compose — an inner `auth.withAuth({ accessToken })` inside an outer `auth.withAuth({ baseURL })` runs with both fields applied.
183183

184+
Unlike `TriggerClient` instances (which stay isolated unless you opt in), `auth.withAuth` keeps the surrounding task context: a call made inside a task still inherits `parentRunId`, version locking, and the test flag, the same as a direct SDK call. See the [isolation contract](/management/multiple-clients#isolation-contract).
185+
184186
<Note>
185187
On runtimes without AsyncLocalStorage (browsers and some edge runtimes), the SDK falls back to
186188
swapping the global config in place for the duration of the callback, which is not safe under

0 commit comments

Comments
 (0)