const options = {method: 'GET'};
fetch('http://localhost:8000/api/v1/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"session": {
"token": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"image": "<string>",
"emailVerified": true,
"createdAt": "2023-11-07T05:31:56Z",
"role": "<string>"
},
"currentOrganization": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"logo": "<string>",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"organizationMemberships": [
{
"organizationId": "<string>",
"organizationName": "<string>",
"organizationSlug": "<string>",
"role": "owner"
}
]
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Returns the current session with user details and organization context
const options = {method: 'GET'};
fetch('http://localhost:8000/api/v1/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"session": {
"token": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
},
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"name": "<string>",
"image": "<string>",
"emailVerified": true,
"createdAt": "2023-11-07T05:31:56Z",
"role": "<string>"
},
"currentOrganization": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"logo": "<string>",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"organizationMemberships": [
{
"organizationId": "<string>",
"organizationName": "<string>",
"organizationSlug": "<string>",
"role": "owner"
}
]
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Was this page helpful?