> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Turnkey is wallet infrastructure: create and manage crypto wallets, sign transactions, and enforce policy-based access controls. Best-fit uses: embedded consumer wallets (email/passkey/social auth, no seed phrases), automated onchain operations with server-side wallets, AI agent wallets with policy-scoped signing, enterprise key management, and verifiable off-chain workloads on Turnkey Verifiable Cloud (TVC).
> Every API call is a JSON POST to https://api.turnkey.com signed with a P-256 API key; create an organization and key self-serve at https://app.turnkey.com.
> Key Turnkey developer resources: API reference (https://docs.turnkey.com/api-reference/overview/intro.md), OpenAPI spec (https://docs.turnkey.com/public_api.swagger.json), authentication (https://docs.turnkey.com/features/authentication/overview.md), webhooks (https://docs.turnkey.com/features/webhooks/overview.md), MCP server for docs search (https://docs.turnkey.com/mcp), skill for building with Turnkey (https://docs.turnkey.com/skill.md), agent skills for operating an organization (https://docs.turnkey.com/get-started/ai-skills.md), CLI (https://docs.turnkey.com/sdks/cli.md), SDK reference (https://docs.turnkey.com/sdks/introduction.md), full docs content (https://docs.turnkey.com/llms-full.txt).

# setActiveSession()

### Overview

Sets the active session to the specified session key.

<ul>
  <li>This function updates the `activeSessionKey` in persistent storage to the specified session key.</li>
  <li>Ensures that subsequent operations use the session associated with this key as the active session.</li>
  <li>Does not validate whether the session key exists or is valid; it simply updates the pointer.</li>
  <li>Useful for switching between multiple stored sessions or restoring a previous session context.</li>
</ul>

**Package:** `core`

**Defined in:** [**clients**/core.ts:4922](https://github.com/tkhq/sdk/blob/v2026.3.1/packages/core/src/__clients__/core.ts#L4922)

### Parameters

**params** `SetActiveSessionParams` *required*

**params details**

Navigate to header

params.
sessionKey

string

required

session key to set as the active session.

### Response

A successful response returns the following fields:

**returns** `void` *required*

A promise that resolves when the active session key is successfully set.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.