Demo Platform

Built to show what
LaunchDarkly can see

Toggle Travel is a fully instrumented travel booking app โ€” every search, booking, error, and AI interaction is observable through LaunchDarkly. Use the pages below to explore each use case.

Use Cases

What you can demo

Each topic maps to a real capability in the LaunchDarkly Observability platform.

๐Ÿš€
Getting Started

Implementing a Feature Flag

The five steps behind every flag in Toggle Travel โ€” import the SDK, initialize the client, build a context, evaluate the flag, and track events. The actual code, server and browser.

See the code โ†’
๐Ÿšจ
Errors

Booking Errors & the Atlantis Problem

See how a hard-coded 404 on the Atlantis destination surfaces in real time on the LD Observability Errors page โ€” with full browser and server context.

Explore use case โ†’
๐Ÿ”€
Feature Flags Coming soon

Feature Flag Evaluations

How LaunchDarkly tracks every flag evaluation in the browser and on the server, and ties them to sessions, traces, and user context.

๐Ÿ“น
Session Replay

Session Replay

Watch real user sessions โ€” every click, scroll, and rage-click recorded and linked back to the traces and flag evaluations active at the time. Built on rrweb.

Explore use case โ†’
๐Ÿ›ก
Guarded Release

Guarded Releases & Auto-Rollback

Ship a change to a slice of traffic, let LaunchDarkly watch the booking-error rate, and revert automatically when the treatment arm regresses โ€” the daily 7am checkout incident, self-healed.

Explore use case โ†’
๐Ÿงช
Experiments & Bandits

Experiments & Multi-Armed Bandits

An A/B/n experiment on the promo banner that names the highest-converting message, and a bandit that auto-optimizes search ranking toward the most engaging sort.

Explore use case โ†’
๐Ÿ”ญ
Traces Coming soon

Distributed Traces

Full request traces from browser click through Express route to external service calls โ€” with the LD context that was active for that request.

๐Ÿ“‹
Logs Coming soon

Logs

Structured Winston logs forwarded to LD Observability via a custom transport, correlated to traces and sessions automatically.

๐Ÿ“ˆ
Metrics & Alerts Coming soon

Metrics & Alerts

Custom booking revenue and failure metrics tracked as LD events, with threshold and anomaly alerts routing to Slack when something goes wrong.

How it's wired

The observability stack

Every signal in this app flows through the LaunchDarkly Observability SDK โ€” browser and server.

โš™๏ธ Node.js + Express backend
๐ŸŒ Vanilla JS frontend
๐Ÿ”ต LD Observability Node SDK
๐Ÿ”ต LD Observability Browser SDK
๐Ÿ“น LD Session Replay SDK
๐Ÿด LD Feature Flag JS SDK
๐Ÿ“ Winston โ†’ LDTransport
๐Ÿค– Google Gemini (AI Planner)
Getting started

Implementing a feature flag

The five steps behind every flag in Toggle Travel, modeled on the real Node server SDK code in src/launchdarkly.js. The browser SDK works the same way.

1. Import the SDK

Toggle Travel runs the LaunchDarkly Node server SDK, with the Observability plugin loaded alongside it.

const LaunchDarkly = require('@launchdarkly/node-server-sdk');
const { Observability } = require('@launchdarkly/observability-node');

2. Initialize the client

This pulls flag data from LaunchDarkly's edge-based Flag Delivery Network in under 200ms. The Observability plugin wires in traces, logs, and metrics at the same time.

const client = LaunchDarkly.init(process.env.LD_SDK_KEY, {
  plugins: [new Observability({ serviceName: 'toggle-travel' })],
});
await client.waitForInitialization({ timeout: 5 });

3. Build the context

A context describes who (or what) you're evaluating for โ€” and every attribute on it is something you can target, segment, or roll out by. Toggle Travel keys users by their session id (the stable randomization unit) and attaches loyalty tier, geo, and device so the same context works for targeting and experiment bucketing. Server and browser build it identically.

const context = {
  kind: 'multi',
  user: {
    key: req.sessionId,    // stable randomization unit
    name: user.name,
    anonymous: !user.loggedIn,
    plan: user.plan,    // 'Gold' | 'Diamond' โ€” target by loyalty tier
    country: req.geo.country,
  },
  device: {
    key: req.deviceId,
    platform: req.platform,    // 'web' | 'ios' | 'android'
  },
};

4. Evaluate the flag

Every request asks LaunchDarkly for the variation, passing a default. This is the checkout flag that drives the daily guarded release:

const useV2Checkout = await client.variation('new-checkout-flow', context, false);

if (useV2Checkout) {
  // run the new checkout code path
}

5. Track events

Custom events feed metrics, experiments, and guarded-rollout guards. Toggle Travel fires these on booking outcomes:

client.track('confirm-booking', context, { destination_id });
client.track('booking-error', context, { http_status: 500 });
Same shape in the browser. The client SDK (public/js/flags.js) mirrors this: LDClient.initialize(clientSideId, context, { plugins }), then ldClient.variation(key, default) and ldClient.track(event, data) โ€” plus the Session Replay plugin for recordings.