# Weeve Session Event Structures
### Event JSON Wrapper
A CHANNEL sends a data object containing a TYPE and a PAYLOAD
```json=
channel: discussionId
{
type: "eventName",
payload: {}
}
```
There are three categories of session events, delineated chronologically:
- Connection Open/Close Events
- Session Start
- Session Run
- Pre-Stage
- Mid-Stage
- End-Stage
- Session Termination
## Connection Open/Close Events
Create new connection on user /join IF a connection does not already exist
## SESSION START EVENTS
#### Session Initialized (Client Initiated)
```json=
{
type: "sessionInitialized",
payload: {
success: true
}
}
```
#### SessionOpened (Client Initiated)
```json=
{
type: "sessionOpened",
payload: {}
}
```
#### SessionStarted (Client Initiated)
```json=
{
type: "sessionStarted",
payload: {}
}
```
## SESSION RUN - Pre-Stage
#### Stage started ()
```json=
{
type: "stageStarted",
payload: {
stageInfo: StageInfo{
roomID: string,
description: string,
duration: number,
transition_type: string
}
}
}
```
#### User Ping (Server Initiated)
```json=
{
type: "ping",
payload: {
success: true
}
}
```
####
## SESSION RUN - Mid-Stage
#### Facilitator Message (Client Initiated)
```json=
{
type: "msg",
payload: {
message: string,
}
}
```
#### Time Prompt (Server Initiated)
```json=
{
type: "timePrompt",
payload: {
message: string,
duration: number(secs)
}
}
```
#### Sync Time (Server Initiated)
```json=
{
type: "syncTime",
payload: {
timeLeft: number(secs)
}
}
```
## SESSION RUN - End-Stage
#### Stage End (Server Initiated)
```json=
{
type: "stageEnd",
payload: {
success: true
}
}
```
####
## SESSION END EVENTS
#### Session Ended (Server/Client Initiated)
```json=
{
type: "sessionEnd",
payload: {
success: true
}
}
```