Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.k42.com/llms.txt

Use this file to discover all available pages before exploring further.

Close a session object

close_session

Params

void

Response

success
boolean
required
Whether or not the session operation was successful.
message
string
A failure message in the event of failure.
id
string
required
The id of the session
total
number
required
The basket total
items
Basket Item Array
required
An array of session basket items
import * as sdk from "k42-sdk"

const session = sdk.createSession("session-ref");
if (!session.success) {
  console.log(`Failed to create session - ${session.message}`)
  return;
}

let closeResult = sdk.closeSession();
if (!closeResult.success) {
  console.log(`Failed to close session - ${closeResult.message}`)
  return;
}