Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / LimitedEventSessionEvents

Interface: LimitedEventSessionEvents ​

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:150

Events emitted by a direct Limited Event presence session.

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('change', changePayload => {
  console.log(changePayload)
})

stopListening()

Properties ​

change ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('change', changePayload => {
  console.log(changePayload)
})

stopListening()

change: LimitedEventSessionState

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:151


connectionState ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('connectionState', connectionStatePayload => {
  console.log(connectionStatePayload)
})

stopListening()

connectionState: ConnectionState

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:152


error ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('error', errorPayload => {
  console.log(errorPayload)
})

stopListening()

error: ErrorPayload

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:153


message ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('message', messagePayload => {
  console.log(messagePayload)
})

stopListening()

message: LimitedEventServerMessage

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:154


pong ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('pong', pongPayload => {
  console.log(pongPayload)
})

stopListening()

pong: PongPayload

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:155


snapshot ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Keep seatToken private; it authenticates this Limited Event seat.
const limitedEventSession = simulatorClient.limitedEvents.createSession({
  eventId: 'event_123',
  seatToken: 'limited_token_123',
})

// Listener payloads are typed by the event name.
const stopListening = limitedEventSession.on('snapshot', snapshotPayload => {
  console.log(snapshotPayload)
})

stopListening()

snapshot: LimitedEventSnapshot

Defined in: packages/ts-sdk/src/resources/limited-event-types.ts:156

Released under the MIT License.