https://vercel.com/guides/session-store-nextjs-redis-vercel-kv
Unanswered
American Kestrel posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American KestrelOP
https://vercel.com/guides/session-store-nextjs-redis-vercel-kv
In this link, all the code that's given, except for the last block, where do I add it? the functions for getSessionId, setSessionId, get, getAll, set, etc.
I have a next.js 13.4 repo
Should I add it in my api/<whatever>/route.ts?
In this link, all the code that's given, except for the last block, where do I add it? the functions for getSessionId, setSessionId, get, getAll, set, etc.
I have a next.js 13.4 repo
Should I add it in my api/<whatever>/route.ts?
11 Replies
![Avatar](https://cdn.discordapp.com/avatars/809942393637306400/1e4e5a29a08b96de9a1e3d3520b5e771.webp?size=256)
tafutada777
i guess you can define them in ./session-store file. 1, 2 3 can sit in the same file i guess.
so you can grab them
import { get, set, getSessionId } from './session-store';
import { get, set, getSessionId } from './session-store';
obviously it accesses cookie and kv, so it works in server side codes only. it does not work in client side codes.
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American KestrelOP
Oh! Ok!
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American KestrelOP
Hi, another doubt
this happens
![Image](https://cdn.discordapp.com/attachments/1144602230880739341/1144631883267838032/Screenshot_2023-08-25_at_19.28.20.png)
when I've cleared commented it out
![Image](https://cdn.discordapp.com/attachments/1144602230880739341/1144631980902858883/Screenshot_2023-08-25_at_19.28.39.png)
![Avatar](https://cdn.discordapp.com/avatars/809942393637306400/1e4e5a29a08b96de9a1e3d3520b5e771.webp?size=256)
tafutada777
u need to specify http part. like https://www.something.com/api/youtube
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American KestrelOP
but what if we're running locally
![Avatar](https://cdn.discordapp.com/avatars/809942393637306400/1e4e5a29a08b96de9a1e3d3520b5e771.webp?size=256)
tafutada777
http://localhost/api/youtube
but calling yourself is not recommended.
but calling yourself is not recommended.
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American KestrelOP
If I want to make two separate API calls to POST under api/youtube
how can I do that?
should I just make two different folders
api/youtube1
api/youtube2
how can I do that?
should I just make two different folders
api/youtube1
api/youtube2