Skip to main content

Rail Deck is being prepared for an invitation-only Alpha. Check current availability

Developer documentation

Operator and preferences

Read the signed-in person and their appearance preferences.

Source 0.1.0 Private source package

How the calls fit together

Read current identity and appearance together. Changing preferences is a separate deliberate action.

JavaScript examples

Supply your configured client. Each call awaits a decoded result; errors pass to your caller. These identifiers and values are fictional. Use selected development records and review every change before running it. Opening this page sends no API requests.

See the complete TypeScript workflow · Explore the Node starter

session.getMe

Loads the current Rail Deck user, account memberships, and active account.

const result = await client.session.getMe(
  {}
);
TypeScript parameters and return type
requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckMeResponse>.

Example evidence: Retained SDK transport fixture.

session.getAppearance

Loads the signed-in person's application-wide appearance preference.

const result = await client.session.getAppearance(
  {}
);
TypeScript parameters and return type
requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckProductAppearanceResponseV1>.

Example evidence: Retained SDK transport fixture.

session.updateAppearance

Replaces the signed-in person's application-wide appearance preference.

const result = await client.session.updateAppearance(
  {
    "style": "signal",
    "colourMode": "dark"
  },
  {}
);
TypeScript parameters and return type
input · required
UpdateRailDeckProductAppearanceRequestV1

The operation input. Use the complete typed shape shown in the example and retain reviewed versions for writes.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckProductAppearanceResponseV1>.

Example evidence: Retained SDK transport fixture.

session.signOutAllDevices

Invalidates every Rail Deck token issued from the user's existing provider sessions and asks Keycloak to remove those sessions.

const result = await client.session.signOutAllDevices(
  {}
);
TypeScript parameters and return type
requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckSignOutAllDevicesResponse>.

Example evidence: Retained SDK transport fixture.

Download all TypeScript method examples

JavaScript calls and TypeScript downloads are checked through the real SDK using local response fixtures. This verifies the calls and decoding for those fixtures.

Handle errors and uncertain outcomes

Choose another feature

The complete TypeScript workflow

Follow how the calls fit together, including the review and recovery steps. Supply your configured client and explicitly selected development records. Importing the download performs no requests; mutations are never retried automatically.

import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration';

/**
 * Read current identity before loading personal appearance settings.
 * @param client - Configured client; the caller owns current authority.
 * @param signal - Caller-owned cancellation signal.
 * @returns Current identity and appearance, without saving a preference.
 */
export async function readOperatorContext(
  client: Client,
  signal: AbortSignal,
) {
  const options = { signal, timeoutMs: 15_000 };
  const person = await client.session.getMe(options);
  const appearance = await client.session.getAppearance(options);
  return { person, appearance };
}
Download TypeScript example

Information reviewed .