Skip to main content
This guide covers advanced topics for getting the most out of the Stringboot Web SDK.

Language Switching

Stringboot makes it easy to switch languages dynamically without reloading the page.

Vanilla JS

React

Getting Available Languages

You can fetch the list of active languages configured in your dashboard.

Multi-Tab Synchronization

The SDK automatically synchronizes language changes across browser tabs using the BroadcastChannel API. If a user changes the language in one tab, all other open tabs for your application will instantly update to match.

Performance Optimization

Stringboot is designed for high performance with minimal impact on your application’s load time.

Caching Strategy

  1. Memory Cache: Sub-millisecond access for frequently used strings.
  2. IndexedDB: Persistent offline storage. Strings are loaded from here on startup.
  3. Network: Only used for initial fetch or delta updates.

Monitoring Cache Stats

You can inspect the cache usage to debug performance issues.

Parallel Loading

When fetching strings dynamically (outside of hooks), use Promise.all to fetch them in parallel.

A/B Testing Integration

Stringboot supports native A/B testing for string variations. You can pass an analyticsHandler during initialization to track experiment exposure.
When a user requests a string that is part of an experiment, Stringboot will:
  1. Deterministically assign a variant (Control or Variant B) based on the user’s session.
  2. Return the appropriate string value.
  3. Trigger the analyticsHandler callback so you can log the exposure.