Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / LimitedEventSession

Interface: LimitedEventSession ​

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

Live presence session for one directly-created Limited Event seat.

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',
})

console.log(limitedEventSession)

Properties ​

__v_skip ​

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',
})

const { __v_skip } = limitedEventSession

console.log(__v_skip)

readonly __v_skip: true

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


close ​

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',
})

const { close } = limitedEventSession

console.log(close)

close: () => void

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

Returns ​

void


connect ​

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',
})

const { connect } = limitedEventSession

console.log(connect)

connect: () => Promise<LimitedEventSession>

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

Returns ​

Promise<LimitedEventSession>


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',
})

const { connectionState } = limitedEventSession

console.log(connectionState)

readonly connectionState: ConnectionState

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


errorMessages ​

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',
})

const { errorMessages } = limitedEventSession

console.log(errorMessages)

readonly errorMessages: readonly string[]

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


errors ​

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',
})

const { errors } = limitedEventSession

console.log(errors)

readonly errors: readonly ErrorPayload[]

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


on ​

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',
})

const { on } = limitedEventSession

console.log(on)

on: <TKey>(event, listener) => () => void

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

Type Parameters ​

TKey ​

TKey extends keyof LimitedEventSessionEvents

Parameters ​

event ​

TKey

listener ​

(value) => void

Returns ​

() => void


ping ​

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',
})

const { ping } = limitedEventSession

console.log(ping)

ping: (nonce?) => void

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

Parameters ​

nonce? ​

string

Returns ​

void


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',
})

const { snapshot: limitedEventSnapshot } = limitedEventSession

console.log(limitedEventSnapshot)

readonly snapshot: LimitedEventSnapshot | undefined

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

Released under the MIT License.