-
Notifications
You must be signed in to change notification settings - Fork 463
Expand file tree
/
Copy pathserver.Auth0Client.html
More file actions
101 lines (98 loc) · 94.3 KB
/
Copy pathserver.Auth0Client.html
File metadata and controls
101 lines (98 loc) · 94.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Auth0Client | @auth0/nextjs-auth0 - v4.18.0</title><meta name="description" content="Documentation for @auth0/nextjs-auth0"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@auth0/nextjs-auth0 - v4.18.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/server.html">server</a></li><li><a href="" aria-current="page">Auth0Client</a></li></ul><h1>Class Auth0Client</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L428">src/server/client.ts:428</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="#mfa" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>mfa</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#connectaccount" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect<wbr/>Account</span></a>
<a href="#createfetcher" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Fetcher</span></a>
<a href="#customtokenexchange" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>custom<wbr/>Token<wbr/>Exchange</span></a>
<a href="#getaccesstoken" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Access<wbr/>Token</span></a>
<a href="#getaccesstokenforconnection" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Access<wbr/>Token<wbr/>For<wbr/>Connection</span></a>
<a href="#getsession" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Session</span></a>
<a href="#gettokenbybackchannelauth" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Token<wbr/>By<wbr/>Backchannel<wbr/>Auth</span></a>
<a href="#middleware" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>middleware</span></a>
<a href="#startinteractivelogin" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start<wbr/>Interactive<wbr/>Login</span></a>
<a href="#updatesession" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update<wbr/>Session</span></a>
<a href="#withapiauthrequired" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>with<wbr/>Api<wbr/>Auth<wbr/>Required</span></a>
<a href="#withpageauthrequired" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>with<wbr/>Page<wbr/>Auth<wbr/>Required</span></a>
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorauth0client"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Auth0Client</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <a href="../interfaces/types.Auth0ClientOptions.html" class="tsd-signature-type tsd-kind-interface">Auth0ClientOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Auth0Client</a><a href="#constructorauth0client" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.Auth0ClientOptions.html" class="tsd-signature-type tsd-kind-interface">Auth0ClientOptions</a><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Auth0Client</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L436">src/server/client.ts:436</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Accessors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="mfa"><span>mfa</span><a href="#mfa" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="mfamfa"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">mfa</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ServerMfaClient</span></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>MFA API for server-side operations.</p>
<p>Provides access to MFA methods that require encrypted mfa_token from MfaRequiredError:</p>
<ul>
<li>getAuthenticators: List enrolled MFA factors</li>
<li>challenge: Initiate MFA challenge (OTP/OOB)</li>
<li>verify: Complete MFA verification</li>
</ul>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">ServerMfaClient</span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-handling-mfa-required-scenario">Example: Handling MFA required scenario<a href="#example-handling-mfa-required-scenario" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> { </span><span class="hl-7">token</span><span class="hl-1"> } = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-0">getAccessToken</span><span class="hl-1">({ </span><span class="hl-6">audience:</span><span class="hl-1"> </span><span class="hl-2">'https://api.example.com'</span><span class="hl-1"> });</span><br/><span class="hl-1">} </span><span class="hl-5">catch</span><span class="hl-1"> (</span><span class="hl-6">error</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-6">error</span><span class="hl-1"> </span><span class="hl-3">instanceof</span><span class="hl-1"> </span><span class="hl-9">MfaRequiredError</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-8">// Get available authenticators</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">authenticators</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-6">mfa</span><span class="hl-1">.</span><span class="hl-0">getAuthenticators</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-6">mfaToken:</span><span class="hl-1"> </span><span class="hl-6">error</span><span class="hl-1">.</span><span class="hl-6">mfa_token</span><br/><span class="hl-1"> });</span><br/><br/><span class="hl-1"> </span><span class="hl-8">// Initiate challenge</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">challenge</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-6">mfa</span><span class="hl-1">.</span><span class="hl-0">challenge</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-6">mfaToken:</span><span class="hl-1"> </span><span class="hl-6">error</span><span class="hl-1">.</span><span class="hl-6">mfa_token</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">challengeType:</span><span class="hl-1"> </span><span class="hl-2">'otp'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">authenticatorId:</span><span class="hl-1"> </span><span class="hl-6">authenticators</span><span class="hl-1">[</span><span class="hl-4">0</span><span class="hl-1">].</span><span class="hl-6">id</span><br/><span class="hl-1"> });</span><br/><br/><span class="hl-1"> </span><span class="hl-8">// Verify code</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">tokens</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-6">mfa</span><span class="hl-1">.</span><span class="hl-0">verify</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-6">mfaToken:</span><span class="hl-1"> </span><span class="hl-6">error</span><span class="hl-1">.</span><span class="hl-6">mfa_token</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">otp:</span><span class="hl-1"> </span><span class="hl-2">'123456'</span><br/><span class="hl-1"> });</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1143">src/server/client.ts:1143</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connectaccount"><span>connect<wbr/>Account</span><a href="#connectaccount" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="connectaccount-1"><span class="tsd-kind-call-signature">connectAccount</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.ConnectAccountOptions.html" class="tsd-signature-type tsd-kind-interface">ConnectAccountOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#connectaccount-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Initiates the Connect Account flow to connect a third-party account to the user's profile.
If the user does not have an active session, a <code>ConnectAccountError</code> is thrown.</p>
<p>This method first attempts to obtain an access token with the <code>create:me:connected_accounts</code> scope
for the My Account API to create a connected account for the user.</p>
<p>The user will then be redirected to authorize the connection with the third-party provider.</p>
<p>You must enable <code>Offline Access</code> from the Connection Permissions settings to be able to use the connection with Connected Accounts.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.ConnectAccountOptions.html" class="tsd-signature-type tsd-kind-interface">ConnectAccountOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1373">src/server/client.ts:1373</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="createfetcher"><span>create<wbr/>Fetcher</span><a href="#createfetcher" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="createfetcher-1"><span class="tsd-kind-call-signature">createFetcher</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Response</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">baseUrl</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">fetch</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CustomFetchImpl</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">getAccessToken</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">AccessTokenFactory</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">useDPoP</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Fetcher</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#createfetcher-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a configured Fetcher instance for making authenticated API requests.</p>
<p>This method creates a specialized HTTP client that handles:</p>
<ul>
<li>Automatic access token retrieval and injection</li>
<li>DPoP (Demonstrating Proof-of-Possession) proof generation when enabled</li>
<li>Token refresh and session management</li>
<li>Error handling and retry logic for DPoP nonce errors</li>
<li>Base URL resolution for relative requests</li>
</ul>
<p>The fetcher provides a high-level interface for making requests to protected resources
without manually handling authentication details.</p>
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="createfetchertoutput"><span class="tsd-kind-type-parameter">TOutput</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Response</span> = <span class="tsd-signature-type">Response</span></span><div class="tsd-comment tsd-typography"><p>Response type that extends the standard Response interface</p>
</div></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></span><div class="tsd-comment tsd-typography"><p>Request object for session context (required for Pages Router, optional for App Router)</p>
</div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">baseUrl</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">fetch</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">CustomFetchImpl</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">getAccessToken</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">AccessTokenFactory</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">useDPoP</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options for the fetcher</p>
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">baseUrl</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Base URL for relative requests. Must be provided if using relative URLs</p>
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">fetch</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">CustomFetchImpl</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><p>Custom fetch implementation. Falls back to global fetch if not provided</p>
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">getAccessToken</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">AccessTokenFactory</span></h5><div class="tsd-comment tsd-typography"><p>Custom access token factory function. If not provided, uses the default from hooks</p>
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">useDPoP</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Enable DPoP for this fetcher instance (overrides global setting)</p>
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Fetcher</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#createfetchertoutput">TOutput</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>Promise that resolves to a configured Fetcher instance</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws">Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>AccessTokenError when no active session exists</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">import</span><span class="hl-1"> { </span><span class="hl-6">auth0</span><span class="hl-1"> } </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">"@/lib/auth0"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">fetcher</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-0">createFetcher</span><span class="hl-1">(</span><span class="hl-3">undefined</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-6">baseUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://api.example.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">useDPoP:</span><span class="hl-1"> </span><span class="hl-3">true</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">response</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">fetcher</span><span class="hl-1">.</span><span class="hl-0">fetchWithAuth</span><span class="hl-1">(</span><span class="hl-2">"/users"</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">users</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">response</span><span class="hl-1">.</span><span class="hl-0">json</span><span class="hl-1">();</span>
</code><button type="button">Copy</button></pre>
</div><div class="tsd-tag-see"><h4 class="tsd-anchor-link" id="see">See<a href="#see" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><ul>
<li>Fetcher for details on using the returned fetcher instance</li>
<li>FetcherMinimalConfig for available configuration options</li>
</ul>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1645">src/server/client.ts:1645</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="customtokenexchange"><span>custom<wbr/>Token<wbr/>Exchange</span><a href="#customtokenexchange" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="customtokenexchange-1"><span class="tsd-kind-call-signature">customTokenExchange</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.CustomTokenExchangeOptions.html" class="tsd-signature-type tsd-kind-interface">CustomTokenExchangeOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.CustomTokenExchangeResponse.html" class="tsd-signature-type tsd-kind-interface">CustomTokenExchangeResponse</a><span class="tsd-signature-symbol">></span><a href="#customtokenexchange-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Exchanges an external token for Auth0 tokens using Custom Token Exchange (RFC 8693).</p>
<p>This is a server-only method that does NOT modify the session.
The returned tokens can be used independently or stored by the developer.</p>
<p><strong>Note</strong>: CTE tokens are not cached. The caller is responsible for token storage if needed.</p>
<p>This method can be used in Server Actions, Route Handlers, and API routes.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.CustomTokenExchangeOptions.html" class="tsd-signature-type tsd-kind-interface">CustomTokenExchangeOptions</a></span><div class="tsd-comment tsd-typography"><p>The custom token exchange options</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.CustomTokenExchangeResponse.html" class="tsd-signature-type tsd-kind-interface">CustomTokenExchangeResponse</a><span class="tsd-signature-symbol">></span></h4><p>The token exchange response containing access token and optionally id/refresh tokens</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-1">Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If validation fails or the exchange request fails</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-1">Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-6">auth0</span><span class="hl-1">.</span><span class="hl-0">customTokenExchange</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-6">subjectToken:</span><span class="hl-1"> </span><span class="hl-6">legacyIdToken</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">subjectTokenType:</span><span class="hl-1"> </span><span class="hl-2">'urn:acme:legacy-token'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">audience:</span><span class="hl-1"> </span><span class="hl-2">'https://api.example.com'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">scope:</span><span class="hl-1"> </span><span class="hl-2">'read:data'</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-6">result</span><span class="hl-1">.</span><span class="hl-6">accessToken</span><span class="hl-1">);</span>
</code><button type="button">Copy</button></pre>
</div><div class="tsd-tag-see"><h4 class="tsd-anchor-link" id="see-1">See<a href="#see-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p><a href="https://auth0.com/docs/authenticate/custom-token-exchange">Auth0 CTE Documentation</a></p>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1093">src/server/client.ts:1093</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getaccesstoken"><span>get<wbr/>Access<wbr/>Token</span><a href="#getaccesstoken" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getaccesstoken-1"><span class="tsd-kind-call-signature">getAccessToken</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.GetAccessTokenOptions.html" class="tsd-signature-type tsd-kind-type-alias">GetAccessTokenOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token_type</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><a href="#getaccesstoken-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../types/types.GetAccessTokenOptions.html" class="tsd-signature-type tsd-kind-type-alias">GetAccessTokenOptions</a></span><div class="tsd-comment tsd-typography"><p>Optional configuration for getting the access token.</p>
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="audience"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5><div class="tsd-comment tsd-typography"><p>Please note: If you are passing audience, ensure that the used audiences and scopes are
part of the Application's Refresh Token Policies in Auth0 when configuring Multi-Resource Refresh Tokens (MRRT).
<a href="https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token|See">Auth0 Documentation on Multi-resource Refresh Tokens</a></p>
</div></li><li class="tsd-parameter"><h5 id="refresh"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">refresh</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5></li><li class="tsd-parameter"><h5 id="scope"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token_type</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L783">src/server/client.ts:783</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="getaccesstoken-2"><span class="tsd-kind-call-signature">getAccessToken</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">res</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.GetAccessTokenOptions.html" class="tsd-signature-type tsd-kind-type-alias">GetAccessTokenOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token_type</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><a href="#getaccesstoken-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>getAccessToken returns the access token.</p>
<p>This method can be used in middleware and <code>getServerSideProps</code>, API routes in the <strong>Pages Router</strong>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a></span><div class="tsd-comment tsd-typography"><p>The request object.</p>
</div></li><li><span><span class="tsd-kind-parameter">res</span>: <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a></span><div class="tsd-comment tsd-typography"><p>The response object.</p>
</div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../types/types.GetAccessTokenOptions.html" class="tsd-signature-type tsd-kind-type-alias">GetAccessTokenOptions</a></span><div class="tsd-comment tsd-typography"><p>Optional configuration for getting the access token.</p>
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="audience"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5><div class="tsd-comment tsd-typography"><p>Please note: If you are passing audience, ensure that the used audiences and scopes are
part of the Application's Refresh Token Policies in Auth0 when configuring Multi-Resource Refresh Tokens (MRRT).
<a href="https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token|See">Auth0 Documentation on Multi-resource Refresh Tokens</a></p>
</div></li><li class="tsd-parameter"><h5 id="refresh"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">refresh</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5></li><li class="tsd-parameter"><h5 id="scope"><code class="tsd-tag">Optional</code><span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></h5></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">audience</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">scope</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">token_type</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L801">src/server/client.ts:801</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getaccesstokenforconnection"><span>get<wbr/>Access<wbr/>Token<wbr/>For<wbr/>Connection</span><a href="#getaccesstokenforconnection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getaccesstokenforconnection-1"><span class="tsd-kind-call-signature">getAccessTokenForConnection</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.AccessTokenForConnectionOptions.html" class="tsd-signature-type tsd-kind-interface">AccessTokenForConnectionOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span><a href="#getaccesstokenforconnection-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves an access token for a connection.</p>
<p>This method can be used in Server Components, Server Actions, and Route Handlers in the <strong>App Router</strong>.</p>
<p>NOTE: Server Components cannot set cookies. Calling <code>getAccessTokenForConnection()</code> in a Server Component will cause the access token to be refreshed, if it is expired, and the updated token set will not to be persisted.
It is recommended to call <code>getAccessTokenForConnection(req, res)</code> in the middleware if you need to retrieve the access token in a Server Component to ensure the updated token set is persisted.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.AccessTokenForConnectionOptions.html" class="tsd-signature-type tsd-kind-interface">AccessTokenForConnectionOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L957">src/server/client.ts:957</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="getaccesstokenforconnection-2"><span class="tsd-kind-call-signature">getAccessTokenForConnection</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.AccessTokenForConnectionOptions.html" class="tsd-signature-type tsd-kind-interface">AccessTokenForConnectionOptions</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">res</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span><a href="#getaccesstokenforconnection-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves an access token for a connection.</p>
<p>This method can be used in middleware and <code>getServerSideProps</code>, API routes in the <strong>Pages Router</strong>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.AccessTokenForConnectionOptions.html" class="tsd-signature-type tsd-kind-interface">AccessTokenForConnectionOptions</a></span></li><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></span></li><li><span><span class="tsd-kind-parameter">res</span>: <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">expiresAt</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L966">src/server/client.ts:966</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getsession"><span>get<wbr/>Session</span><a href="#getsession" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getsession-1"><span class="tsd-kind-call-signature">getSession</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#getsession-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>getSession returns the session data for the current request.</p>
<p>This method can be used in Server Components, Server Actions, and Route Handlers in the <strong>App Router</strong>.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L708">src/server/client.ts:708</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="getsession-2"><span class="tsd-kind-call-signature">getSession</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#getsession-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>getSession returns the session data for the current request.</p>
<p>This method can be used in middleware and <code>getServerSideProps</code>, API routes in the <strong>Pages Router</strong>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L715">src/server/client.ts:715</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="gettokenbybackchannelauth"><span>get<wbr/>Token<wbr/>By<wbr/>Backchannel<wbr/>Auth</span><a href="#gettokenbybackchannelauth" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="gettokenbybackchannelauth-1"><span class="tsd-kind-call-signature">getTokenByBackchannelAuth</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.BackchannelAuthenticationOptions.html" class="tsd-signature-type tsd-kind-interface">BackchannelAuthenticationOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.BackchannelAuthenticationResponse.html" class="tsd-signature-type tsd-kind-interface">BackchannelAuthenticationResponse</a><span class="tsd-signature-symbol">></span><a href="#gettokenbybackchannelauth-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Authenticates using Client-Initiated Backchannel Authentication and returns the token set and optionally the ID token claims and authorization details.</p>
<p>This method will initialize the backchannel authentication process with Auth0, and poll the token endpoint until the authentication is complete.</p>
<p>Using Client-Initiated Backchannel Authentication requires the feature to be enabled in the Auth0 dashboard.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.BackchannelAuthenticationOptions.html" class="tsd-signature-type tsd-kind-interface">BackchannelAuthenticationOptions</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/types.BackchannelAuthenticationResponse.html" class="tsd-signature-type tsd-kind-interface">BackchannelAuthenticationResponse</a><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><h4 class="tsd-anchor-link" id="see-2">See<a href="#see-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p><a href="https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow">https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow</a></p>
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1348">src/server/client.ts:1348</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="middleware"><span>middleware</span><a href="#middleware" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="middleware-1"><span class="tsd-kind-call-signature">middleware</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#middleware-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>middleware mounts the SDK routes to run as a middleware function.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L694">src/server/client.ts:694</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="startinteractivelogin"><span>start<wbr/>Interactive<wbr/>Login</span><a href="#startinteractivelogin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="startinteractivelogin-1"><span class="tsd-kind-call-signature">startInteractiveLogin</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <a href="../interfaces/types.StartInteractiveLoginOptions.html" class="tsd-signature-type tsd-kind-interface">StartInteractiveLoginOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#startinteractivelogin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/types.StartInteractiveLoginOptions.html" class="tsd-signature-type tsd-kind-interface">StartInteractiveLoginOptions</a><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1332">src/server/client.ts:1332</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="updatesession"><span>update<wbr/>Session</span><a href="#updatesession" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="updatesession-1"><span class="tsd-kind-call-signature">updateSession</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">res</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Response</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">session</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#updatesession-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>updateSession updates the session of the currently authenticated user. If the user does not have a session, an error is thrown.</p>
<p>This method can be used in middleware and <code>getServerSideProps</code>, API routes, and middleware in the <strong>Pages Router</strong>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">req</span>: <span class="tsd-signature-type">NextRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Request</span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterRequest.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterRequest</a></span></li><li><span><span class="tsd-kind-parameter">res</span>: <span class="tsd-signature-type">Response</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextResponse</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <a href="../types/types.PagesRouterResponse.html" class="tsd-signature-type tsd-kind-type-alias">PagesRouterResponse</a></span></li><li><span><span class="tsd-kind-parameter">session</span>: <a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1155">src/server/client.ts:1155</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="updatesession-2"><span class="tsd-kind-call-signature">updateSession</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">session</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#updatesession-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>updateSession updates the session of the currently authenticated user. If the user does not have a session, an error is thrown.</p>
<p>This method can be used in Server Actions and Route Handlers in the <strong>App Router</strong>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">session</span>: <a href="../interfaces/types.SessionData.html" class="tsd-signature-type tsd-kind-interface">SessionData</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1166">src/server/client.ts:1166</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="withapiauthrequired"><span>with<wbr/>Api<wbr/>Auth<wbr/>Required</span><a href="#withapiauthrequired" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="withapiauthrequired-1"><span class="tsd-kind-call-signature">withApiAuthRequired</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">apiRoute</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AppRouteHandlerFn</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextApiHandler</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextApiRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextRequest</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">resOrParams</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AppRouteHandlerFnContext</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextApiResponse</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">unknown</span><a href="#withapiauthrequired-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">apiRoute</span>: <span class="tsd-signature-type">AppRouteHandlerFn</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextApiHandler</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">req</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NextApiRequest</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextRequest</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">resOrParams</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AppRouteHandlerFnContext</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NextApiResponse</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">unknown</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1444">src/server/client.ts:1444</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="withpageauthrequired"><span>with<wbr/>Page<wbr/>Auth<wbr/>Required</span><a href="#withpageauthrequired" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="withpageauthrequired-1"><span class="tsd-kind-call-signature">withPageAuthRequired</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="../types/server.PageRoute.html" class="tsd-signature-type tsd-kind-type-alias">PageRoute</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">ParsedUrlQuery</span><span class="tsd-signature-symbol">></span><a href="#withpageauthrequired-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="../types/server.PageRoute.html" class="tsd-signature-type tsd-kind-type-alias">PageRoute</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">ParsedUrlQuery</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1413">src/server/client.ts:1413</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="withpageauthrequired-2"><span class="tsd-kind-call-signature">withPageAuthRequired</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp">P</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredq">Q</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">ParsedUrlQuery</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">ParsedUrlQuery</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">:</span> <a href="../types/server.WithPageAuthRequiredPageRouterOptions.html" class="tsd-signature-type tsd-kind-type-alias">WithPageAuthRequiredPageRouterOptions</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp">P</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredq">Q</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../types/server.PageRoute.html" class="tsd-signature-type tsd-kind-type-alias">PageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp">P</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredq">Q</a><span class="tsd-signature-symbol">></span><a href="#withpageauthrequired-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="withpageauthrequiredp"><span class="tsd-kind-type-parameter">P</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span> = <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-index-signature">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span></span></li><li><span id="withpageauthrequiredq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">ParsedUrlQuery</span> = <span class="tsd-signature-type">ParsedUrlQuery</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">opts</span>: <a href="../types/server.WithPageAuthRequiredPageRouterOptions.html" class="tsd-signature-type tsd-kind-type-alias">WithPageAuthRequiredPageRouterOptions</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp">P</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredq">Q</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/server.PageRoute.html" class="tsd-signature-type tsd-kind-type-alias">PageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp">P</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredq">Q</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1415">src/server/client.ts:1415</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="withpageauthrequired-3"><span class="tsd-kind-call-signature">withPageAuthRequired</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/server.AppRouterPageRouteOpts.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRouteOpts</a> <span class="tsd-signature-symbol">=</span> <a href="../types/server.AppRouterPageRouteOpts.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRouteOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <a href="../types/server.AppRouterPageRoute.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?:</span> <a href="../types/server.WithPageAuthRequiredAppRouterOptions.html" class="tsd-signature-type tsd-kind-type-alias">WithPageAuthRequiredAppRouterOptions</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../types/server.AppRouterPageRoute.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span><a href="#withpageauthrequired-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="withpageauthrequiredp-1"><span class="tsd-kind-type-parameter">P</span> <span class="tsd-signature-keyword">extends</span> <a href="../types/server.AppRouterPageRouteOpts.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRouteOpts</a> = <a href="../types/server.AppRouterPageRouteOpts.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRouteOpts</a></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <a href="../types/server.AppRouterPageRoute.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span></span></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">opts</span>: <a href="../types/server.WithPageAuthRequiredAppRouterOptions.html" class="tsd-signature-type tsd-kind-type-alias">WithPageAuthRequiredAppRouterOptions</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/server.AppRouterPageRoute.html" class="tsd-signature-type tsd-kind-type-alias">AppRouterPageRoute</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#withpageauthrequiredp-1">P</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/nextjs-auth0/blob/b59e9077b28c464c436f010d0ccf01d97a5efec4/src/server/client.ts#L1420">src/server/client.ts:1420</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#mfa"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>mfa</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#connectaccount"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect<wbr/>Account</span></a><a href="#createfetcher"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Fetcher</span></a><a href="#customtokenexchange"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>custom<wbr/>Token<wbr/>Exchange</span></a><a href="#getaccesstoken"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Access<wbr/>Token</span></a><a href="#getaccesstokenforconnection"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Access<wbr/>Token<wbr/>For<wbr/>Connection</span></a><a href="#getsession"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Session</span></a><a href="#gettokenbybackchannelauth"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Token<wbr/>By<wbr/>Backchannel<wbr/>Auth</span></a><a href="#middleware"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>middleware</span></a><a href="#startinteractivelogin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start<wbr/>Interactive<wbr/>Login</span></a><a href="#updatesession"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update<wbr/>Session</span></a><a href="#withapiauthrequired"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>with<wbr/>Api<wbr/>Auth<wbr/>Required</span></a><a href="#withpageauthrequired"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>with<wbr/>Page<wbr/>Auth<wbr/>Required</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@auth0/nextjs-auth0 - v4.18.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>