go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/chirp/pkg/static/_nextjs/src/app/api.ts (about) 1 /** 2 * Copyright (c) 2024 - Present. Will Charczuk. All rights reserved. 3 * Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository. 4 */ 5 export interface Session { 6 userID: string 7 baseURL?: string 8 sessionID: string 9 createdUTC?: Date 10 expiresUTC?: Date 11 userAgent?: string 12 remoteAddr?: string 13 locale?: string 14 state?: any 15 } 16 17 export async function getSession(baseURL: string): Promise<Session> { 18 const res = await fetch(`${baseURL}/api/v1/session`); 19 const data = await res.json(); 20 return data as Session; 21 };