(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60849],{95641:function(e,i,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reference/upstash-redis-adapter",function(){return s(33179)}])},33179:function(e,i,s){"use strict";s.r(i),s.d(i,{useTOC:function(){return h}});var r=s(651),t=s(64464),n=s(46635),a=s(19829),d=s(29920),l=s(74661);function h(e){return[{value:"Installation",id:"installation",depth:2},{value:"UpstashRedisAdapterOptions",id:"upstashredisadapteroptions",depth:2},{value:"Properties",id:"properties",depth:3},{value:"accountByUserIdPrefix?",id:"accountbyuseridprefix",depth:4},{value:"accountKeyPrefix?",id:"accountkeyprefix",depth:4},{value:"baseKeyPrefix?",id:"basekeyprefix",depth:4},{value:"emailKeyPrefix?",id:"emailkeyprefix",depth:4},{value:"sessionByUserIdKeyPrefix?",id:"sessionbyuseridkeyprefix",depth:4},{value:"sessionKeyPrefix?",id:"sessionkeyprefix",depth:4},{value:"userKeyPrefix?",id:"userkeyprefix",depth:4},{value:"verificationTokenKeyPrefix?",id:"verificationtokenkeyprefix",depth:4},{value:"defaultOptions",id:"defaultoptions",depth:2},{value:"Type declaration",id:"type-declaration",depth:3},{value:"accountByUserIdPrefix",id:"accountbyuseridprefix-1",depth:4},{value:"accountKeyPrefix",id:"accountkeyprefix-1",depth:4},{value:"baseKeyPrefix",id:"basekeyprefix-1",depth:4},{value:"emailKeyPrefix",id:"emailkeyprefix-1",depth:4},{value:"sessionByUserIdKeyPrefix",id:"sessionbyuseridkeyprefix-1",depth:4},{value:"sessionKeyPrefix",id:"sessionkeyprefix-1",depth:4},{value:"userKeyPrefix",id:"userkeyprefix-1",depth:4},{value:"verificationTokenKeyPrefix",id:"verificationtokenkeyprefix-1",depth:4},{value:"UpstashRedisAdapter()",id:"upstashredisadapter",depth:2},{value:"Parameters",id:"parameters",depth:3},{value:"Returns",id:"returns",depth:3},{value:"hydrateDates()",id:"hydratedates",depth:2},{value:"Parameters",id:"parameters-1",depth:3},{value:"Returns",id:"returns-1",depth:3}]}function c(e,i){throw Error("Expected "+(i?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}i.default=(0,t.c)(function(e){let{toc:i=h(e)}=e,s={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",span:"span",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.a)(),...e.components};return d.m||c("$Tabs",!1),d.m.Tab||c("$Tabs.Tab",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{children:"@auth/upstash-redis-adapter"}),"\n",(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:16},children:[(0,r.jsxs)("p",{children:["Official ",(0,r.jsx)("a",{href:"https://docs.upstash.com/redis",children:"Upstash Redis"})," adapter for Auth.js / NextAuth.js."]}),(0,r.jsx)("a",{href:"https://docs.upstash.com/redis",children:(0,r.jsx)("img",{style:{display:"block"},src:"https://authjs.dev/img/adapters/upstash-redis.svg",width:"60"})})]}),"\n",(0,r.jsx)(s.h2,{id:i[0].id,children:i[0].value}),"\n",(0,r.jsxs)(d.m,{items:["npm","pnpm","yarn","bun"],storageKey:"selectedPackageManager",children:[(0,r.jsx)(d.m.Tab,{children:(0,r.jsx)(s.pre,{icon:l.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @upstash/redis"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @auth/upstash-redis-adapter"})]})})})}),(0,r.jsx)(d.m.Tab,{children:(0,r.jsx)(s.pre,{icon:l.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @upstash/redis"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @auth/upstash-redis-adapter"})]})})})}),(0,r.jsx)(d.m.Tab,{children:(0,r.jsx)(s.pre,{icon:l.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"yarn"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @upstash/redis"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @auth/upstash-redis-adapter"})]})})})}),(0,r.jsx)(d.m.Tab,{children:(0,r.jsx)(s.pre,{icon:l.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"bun"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" add"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @upstash/redis"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" @auth/upstash-redis-adapter"})]})})})})]}),"\n",(0,r.jsx)(s.h2,{id:i[1].id,children:i[1].value}),"\n",(0,r.jsx)(s.p,{children:"This is the interface of the Upstash Redis adapter options."}),"\n",(0,r.jsx)(s.h3,{id:i[2].id,children:i[2].value}),"\n",(0,r.jsx)(s.h4,{id:i[3].id,children:i[3].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"accountByUserIdPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"accountByUserId"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[4].id,children:i[4].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"accountKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"account"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[5].id,children:i[5].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"baseKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsx)(s.p,{children:"The base prefix for your keys"}),"\n",(0,r.jsx)(s.h4,{id:i[6].id,children:i[6].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"emailKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"emailKey"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[7].id,children:i[7].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"sessionByUserIdKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"sessionByUserId"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[8].id,children:i[8].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"sessionKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"sessionKey"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[9].id,children:i[9].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"userKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"user"})," key"]}),"\n",(0,r.jsx)(s.h4,{id:i[10].id,children:i[10].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"optional "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"verificationTokenKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string;"})]})})}),"\n",(0,r.jsxs)(s.p,{children:["The prefix for the ",(0,r.jsx)(s.code,{children:"verificationToken"})," key"]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:i[11].id,children:i[11].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsxs)(s.code,{children:[(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"const"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" defaultOptions"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" {"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  accountByUserIdPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:account:by-user-id:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  accountKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:account:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  baseKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' ""'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  emailKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:email:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  sessionByUserIdKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:session:by-user-id:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  sessionKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:session:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  userKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#E36209","--shiki-dark":"#FFAB70"},children:"  verificationTokenKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:":"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:token:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]}),"\n",(0,r.jsx)(s.span,{children:(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"};"})})]})}),"\n",(0,r.jsx)(s.h3,{id:i[12].id,children:i[12].value}),"\n",(0,r.jsx)(s.h4,{id:i[13].id,children:i[13].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"accountByUserIdPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:account:by-user-id:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[14].id,children:i[14].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"accountKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:account:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[15].id,children:i[15].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"baseKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' ""'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[16].id,children:i[16].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"emailKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:email:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[17].id,children:i[17].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"sessionByUserIdKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:session:by-user-id:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[18].id,children:i[18].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"sessionKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:session:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[19].id,children:i[19].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"userKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.h4,{id:i[20].id,children:i[20].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"verificationTokenKeyPrefix"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": string "}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "user:token:"'}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})})}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:i[21].id,children:i[21].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"UpstashRedisAdapter"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(client, options): Adapter"})]})})}),"\n",(0,r.jsx)(s.h3,{id:i[22].id,children:i[22].value}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,r.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.code,{children:"client"})}),(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.code,{children:"Redis"})})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.code,{children:"options"})}),(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.a,{href:"upstash-redis-adapter#upstashredisadapteroptions",children:(0,r.jsx)(s.code,{children:"UpstashRedisAdapterOptions"})})})]})]})]}),"\n",(0,r.jsx)(s.h3,{id:i[23].id,children:i[23].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"express/adapters#adapter",children:(0,r.jsx)(s.code,{children:"Adapter"})})}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:i[24].id,children:i[24].value}),"\n",(0,r.jsx)(s.pre,{icon:l.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-copy":"",children:(0,r.jsx)(s.code,{children:(0,r.jsxs)(s.span,{children:[(0,r.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"hydrateDates"}),(0,r.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(json): any"})]})})}),"\n",(0,r.jsx)(s.h3,{id:i[25].id,children:i[25].value}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,r.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,r.jsx)(s.tbody,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.code,{children:"json"})}),(0,r.jsx)(s.td,{style:{textAlign:"left"},children:(0,r.jsx)(s.code,{children:"object"})})]})})]}),"\n",(0,r.jsx)(s.h3,{id:i[26].id,children:i[26].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"any"})})]})},"/reference/upstash-redis-adapter",{filePath:"pages/reference/upstash-redis-adapter.mdx",pageMap:n.v,frontMatter:{},title:"@auth/upstash-redis-adapter"},"undefined"==typeof RemoteContent?h:RemoteContent.useTOC)},29920:function(e,i,s){"use strict";let r,t,n;s.d(i,{m:function(){return Y}});var a=s(651),d=s(11263),l=s(68662),h=s(92379),c=s(71452),o=s(45542),p=s(76192),x=s(72099),k=s(70207),u=s(50827),j=s(87327);function y({onFocus:e}){let i;let[s,r]=(0,h.useState)(!0),t=(i=(0,h.useRef)(!1),(0,p.e)(()=>(i.current=!0,()=>{i.current=!1}),[]),i);return s?h.createElement(j._,{as:"button",type:"button",features:j.x.Focusable,onFocus:i=>{i.preventDefault();let s,n=50;s=requestAnimationFrame(function i(){if(n--<=0){s&&cancelAnimationFrame(s);return}if(e()){if(cancelAnimationFrame(s),!t.current)return;r(!1);return}s=requestAnimationFrame(i)})}}):null}var g=s(35873),E=s(20237),f=s(76939),F=s(46751),b=s(10138);let v=h.createContext(null);function P({children:e}){let i=h.useRef({groups:new Map,get(e,i){var s;let r=this.groups.get(e);r||(r=new Map,this.groups.set(e,r));let t=null!=(s=r.get(i))?s:0;return r.set(i,t+1),[Array.from(r.keys()).indexOf(i),function(){let e=r.get(i);e>1?r.set(i,e-1):r.delete(i)}]}});return h.createElement(v.Provider,{value:i},e)}function m(e){let i=h.useContext(v);if(!i)throw Error("You must wrap your component in a <StableCollection>");let s=h.useId(),[r,t]=i.current.get(e,s);return h.useEffect(()=>t,[]),r}var w=s(80579),T=((r=T||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r),I=((t=I||{})[t.Less=-1]="Less",t[t.Equal=0]="Equal",t[t.Greater=1]="Greater",t),B=((n=B||{})[n.SetSelectedIndex=0]="SetSelectedIndex",n[n.RegisterTab=1]="RegisterTab",n[n.UnregisterTab=2]="UnregisterTab",n[n.RegisterPanel=3]="RegisterPanel",n[n.UnregisterPanel=4]="UnregisterPanel",n);let C={0(e,i){var s;let r=(0,g.z2)(e.tabs,e=>e.current),t=(0,g.z2)(e.panels,e=>e.current),n=r.filter(e=>{var i;return!(null!=(i=e.current)&&i.hasAttribute("disabled"))}),a={...e,tabs:r,panels:t};if(i.index<0||i.index>r.length-1){let s=(0,E.E)(Math.sign(i.index-e.selectedIndex),{[-1]:()=>1,0:()=>(0,E.E)(Math.sign(i.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(0===n.length)return a;let t=(0,E.E)(s,{0:()=>r.indexOf(n[0]),1:()=>r.indexOf(n[n.length-1])});return{...a,selectedIndex:-1===t?e.selectedIndex:t}}let d=r.slice(0,i.index),l=[...r.slice(i.index),...d].find(e=>n.includes(e));if(!l)return a;let h=null!=(s=r.indexOf(l))?s:e.selectedIndex;return -1===h&&(h=e.selectedIndex),{...a,selectedIndex:h}},1(e,i){if(e.tabs.includes(i.tab))return e;let s=e.tabs[e.selectedIndex],r=(0,g.z2)([...e.tabs,i.tab],e=>e.current),t=e.selectedIndex;return e.info.current.isControlled||-1===(t=r.indexOf(s))&&(t=e.selectedIndex),{...e,tabs:r,selectedIndex:t}},2:(e,i)=>({...e,tabs:e.tabs.filter(e=>e!==i.tab)}),3:(e,i)=>e.panels.includes(i.panel)?e:{...e,panels:(0,g.z2)([...e.panels,i.panel],e=>e.current)},4:(e,i)=>({...e,panels:e.panels.filter(e=>e!==i.panel)})},A=(0,h.createContext)(null);function K(e){let i=(0,h.useContext)(A);if(null===i){let i=Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,K),i}return i}A.displayName="TabsDataContext";let _=(0,h.createContext)(null);function R(e){let i=(0,h.useContext)(_);if(null===i){let i=Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,R),i}return i}function D(e,i){return(0,E.E)(i.type,C,e,i)}_.displayName="TabsActionsContext";let O=b.VN.RenderStrategy|b.VN.Static,U=(0,b.yV)(function(e,i){var s,r;let t=(0,h.useId)(),{id:n=`headlessui-tabs-tab-${t}`,disabled:a=!1,autoFocus:x=!1,...j}=e,{orientation:y,activation:v,selectedIndex:P,tabs:T,panels:I}=K("Tab"),B=R("Tab"),C=K("Tab"),[A,_]=(0,h.useState)(null),D=(0,h.useRef)(null),O=(0,u.T)(D,i,_);(0,p.e)(()=>B.registerTab(D),[B,D]);let U=m("tabs"),S=T.indexOf(D);-1===S&&(S=U);let N=S===P,M=(0,o.z)(e=>{var i;let s=e();if(s===g.fE.Success&&"auto"===v){let e=null==(i=(0,F.r)(D))?void 0:i.activeElement,s=C.tabs.findIndex(i=>i.current===e);-1!==s&&B.change(s)}return s}),z=(0,o.z)(e=>{let i=T.map(e=>e.current).filter(Boolean);if(e.key===w.R.Space||e.key===w.R.Enter){e.preventDefault(),e.stopPropagation(),B.change(S);return}switch(e.key){case w.R.Home:case w.R.PageUp:return e.preventDefault(),e.stopPropagation(),M(()=>(0,g.jA)(i,g.TO.First));case w.R.End:case w.R.PageDown:return e.preventDefault(),e.stopPropagation(),M(()=>(0,g.jA)(i,g.TO.Last))}if(M(()=>(0,E.E)(y,{vertical:()=>e.key===w.R.ArrowUp?(0,g.jA)(i,g.TO.Previous|g.TO.WrapAround):e.key===w.R.ArrowDown?(0,g.jA)(i,g.TO.Next|g.TO.WrapAround):g.fE.Error,horizontal:()=>e.key===w.R.ArrowLeft?(0,g.jA)(i,g.TO.Previous|g.TO.WrapAround):e.key===w.R.ArrowRight?(0,g.jA)(i,g.TO.Next|g.TO.WrapAround):g.fE.Error}))===g.fE.Success)return e.preventDefault()}),V=(0,h.useRef)(!1),L=(0,o.z)(()=>{var e;V.current||(V.current=!0,null==(e=D.current)||e.focus({preventScroll:!0}),B.change(S),(0,f.Y)(()=>{V.current=!1}))}),G=(0,o.z)(e=>{e.preventDefault()}),{isFocusVisible:Y,focusProps:$}=(0,d.F)({autoFocus:x}),{isHovered:q,hoverProps:W}=(0,l.X)({isDisabled:a}),{pressed:X,pressProps:H}=(0,c.x)({disabled:a}),Z=(0,h.useMemo)(()=>({selected:N,hover:q,active:X,focus:Y,autofocus:x,disabled:a}),[N,q,Y,X,x,a]),J=(0,b.dG)({ref:O,onKeyDown:z,onMouseDown:G,onClick:L,id:n,role:"tab",type:(0,k.f)(e,A),"aria-controls":null==(r=null==(s=I[S])?void 0:s.current)?void 0:r.id,"aria-selected":N,tabIndex:N?0:-1,disabled:a||void 0,autoFocus:x},$,W,H);return(0,b.sY)({ourProps:J,theirProps:j,slot:Z,defaultTag:"button",name:"Tabs.Tab"})}),S=(0,b.yV)(function(e,i){let{defaultIndex:s=0,vertical:r=!1,manual:t=!1,onChange:n,selectedIndex:a=null,...d}=e,l=r?"vertical":"horizontal",c=t?"manual":"auto",k=null!==a,j=(0,x.E)({isControlled:k}),E=(0,u.T)(i),[f,F]=(0,h.useReducer)(D,{info:j,selectedIndex:null!=a?a:s,tabs:[],panels:[]}),v=(0,h.useMemo)(()=>({selectedIndex:f.selectedIndex}),[f.selectedIndex]),m=(0,x.E)(n||(()=>{})),w=(0,x.E)(f.tabs),T=(0,h.useMemo)(()=>({orientation:l,activation:c,...f}),[l,c,f]),I=(0,o.z)(e=>(F({type:1,tab:e}),()=>F({type:2,tab:e}))),B=(0,o.z)(e=>(F({type:3,panel:e}),()=>F({type:4,panel:e}))),C=(0,o.z)(e=>{K.current!==e&&m.current(e),k||F({type:0,index:e})}),K=(0,x.E)(k?e.selectedIndex:f.selectedIndex),R=(0,h.useMemo)(()=>({registerTab:I,registerPanel:B,change:C}),[]);return(0,p.e)(()=>{F({type:0,index:null!=a?a:s})},[a]),(0,p.e)(()=>{if(void 0===K.current||f.tabs.length<=0)return;let e=(0,g.z2)(f.tabs,e=>e.current);e.some((e,i)=>f.tabs[i]!==e)&&C(e.indexOf(f.tabs[K.current]))}),h.createElement(P,null,h.createElement(_.Provider,{value:R},h.createElement(A.Provider,{value:T},T.tabs.length<=0&&h.createElement(y,{onFocus:()=>{var e,i;for(let s of w.current)if((null==(e=s.current)?void 0:e.tabIndex)===0)return null==(i=s.current)||i.focus(),!0;return!1}}),(0,b.sY)({ourProps:{ref:E},theirProps:d,slot:v,defaultTag:"div",name:"Tabs"}))))}),N=(0,b.yV)(function(e,i){let{orientation:s,selectedIndex:r}=K("Tab.List"),t=(0,u.T)(i),n=(0,h.useMemo)(()=>({selectedIndex:r}),[r]);return(0,b.sY)({ourProps:{ref:t,role:"tablist","aria-orientation":s},theirProps:e,slot:n,defaultTag:"div",name:"Tabs.List"})}),M=(0,b.yV)(function(e,i){let{selectedIndex:s}=K("Tab.Panels"),r=(0,u.T)(i),t=(0,h.useMemo)(()=>({selectedIndex:s}),[s]);return(0,b.sY)({ourProps:{ref:r},theirProps:e,slot:t,defaultTag:"div",name:"Tabs.Panels"})}),z=(0,b.yV)(function(e,i){var s,r,t,n;let a=(0,h.useId)(),{id:l=`headlessui-tabs-panel-${a}`,tabIndex:c=0,...o}=e,{selectedIndex:x,tabs:k,panels:y}=K("Tab.Panel"),g=R("Tab.Panel"),E=(0,h.useRef)(null),f=(0,u.T)(E,i);(0,p.e)(()=>g.registerPanel(E),[g,E]);let F=m("panels"),v=y.indexOf(E);-1===v&&(v=F);let P=v===x,{isFocusVisible:w,focusProps:T}=(0,d.F)(),I=(0,h.useMemo)(()=>({selected:P,focus:w}),[P,w]),B=(0,b.dG)({ref:f,id:l,role:"tabpanel","aria-labelledby":null==(r=null==(s=k[v])?void 0:s.current)?void 0:r.id,tabIndex:P?c:-1},T);return P||null!=(t=o.unmount)&&!t||null!=(n=o.static)&&n?(0,b.sY)({ourProps:B,theirProps:o,slot:I,defaultTag:"div",features:O,visible:P,name:"Tabs.Panel"}):h.createElement(j._,{"aria-hidden":"true",...B})}),V=Object.assign(U,{Group:S,List:N,Panels:M,Panel:z});var L=s(69577);function G(e){return!!e&&"object"==typeof e&&"label"in e}let Y=Object.assign(function({items:e,selectedIndex:i,defaultIndex:s=0,onChange:r,children:t,storageKey:n}){let[d,l]=(0,h.useState)(s);(0,h.useEffect)(()=>{void 0!==i&&l(i)},[i]),(0,h.useEffect)(()=>{if(!n)return;function e(e){e.key===n&&l(Number(e.newValue))}let i=Number(localStorage.getItem(n));return l(Number.isNaN(i)?0:i),window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[]);let c=(0,h.useCallback)(e=>{if(n){let i=String(e);localStorage.setItem(n,i),window.dispatchEvent(new StorageEvent("storage",{key:n,newValue:i}));return}l(e),r?.(e)},[]);return(0,a.jsxs)(S,{selectedIndex:d,defaultIndex:s,onChange:c,tabIndex:-1,children:[(0,a.jsx)(N,{className:(0,L.Z)("nextra-scrollbar _overflow-x-auto _overscroll-x-contain _overflow-y-hidden","_mt-4 _flex _w-full _gap-2 _border-b _border-gray-200 _pb-px dark:_border-neutral-800"),children:e.map((e,i)=>(0,a.jsx)(V,{disabled:G(e)&&e.disabled,className:(0,L.Z)("_ring-inset","_rounded-t _p-2 _font-medium _leading-5 _transition-colors","_-mb-0.5 _select-none _border-b-2","data-[selected]:!_border-current data-[selected]:!_text-primary-600","_border-transparent _text-gray-600 hover:_border-gray-200 hover:_text-black dark:_text-gray-200 dark:hover:_border-neutral-800 dark:hover:_text-white","disabled:_pointer-events-none disabled:_text-gray-400 disabled:dark:_text-neutral-600"),children:G(e)?e.label:e},i))}),(0,a.jsx)(M,{children:t})]})},{displayName:"Tabs",Tab:function({children:e,unmount:i=!1,...s}){return(0,a.jsx)(z,{...s,unmount:i,className:"_rounded _mt-6",children:e})}})}},function(e){e.O(0,[64464,46635,92888,49774,40179],function(){return e(e.s=95641)}),_N_E=e.O()}]);