Lampix Apps API
  • Introduction
  • Application Development
    • Getting Started
      • Up and Running
      • Boilerplate
    • Step by step app
      • What We'll Build
      • Environment Setup
      • Styling
      • HTML Structure
      • NeuralNetworkClassifier
      • MovementBasedSegmenter
      • Final Step
      • Extras
    • LampixJS
      • API Reference
        • Watcher
        • RegisteredWatcher
        • .watchers.add
        • .watchers.remove
        • .watchers.pauseAll
        • .watchers.resumeAll
        • .presets.button
        • .helpers.rectangle
        • getLampixInfo
        • switchToApp
        • exit
        • getApps
        • getAppConfig
        • getAppMetadata
        • writeJsonToFile
        • readJsonFromFile
        • transformRectCoords
        • constants
      • Examples
        • NeuralNetworkClassifier: Buttons
        • MovementBasedSegmenter
        • Counter App
      • Migrating from v0.x.x to v1.0.0-beta.x
      • Ecosystem
    • Deploying
      • Application Structure (production)
      • Local Deploy
    • Standard Watchers
    • Custom Watchers
      • Description
      • Environment Setup
      • Directory Structure
      • End result
      • QRCodeDetector implementation
    • Community
  • Lampix Simulator
    • Installation
    • Usage
      • Basics
Powered by GitBook
On this page
  • Arguments
  • Returns
  • Example
  • Notes

Was this helpful?

  1. Application Development
  2. LampixJS
  3. API Reference

switchToApp

Change from one application to another.

Arguments

  1. appName (string): Application name equivalent to the value specified in the application's package.json file.

  2. queryParameters (Object, Optional): Plain object with keys used query parameters with their respective values. Note that keys will be converted from camelCase to kebab-case.

Returns

(Promise<void>): A promise that fulfills without arguments.

Example

import lampix from '@lampix/core';

lampix.switchToApp('trivia');

// or

lampix.switchToApp('trivia', {
  switchBackTo: 'survey',
  specialInformation: 42
});

// Query parameters can be easily accessed as follows:
// (also note the camelCase to kebab-case transformation)
// const queryParams = new URLSearchParams(window.location.search);
// queryParams.get('switch-back-to'); // survey
// queryParams.get('special-information') // '42'

Notes

PreviousgetLampixInfoNextexit

Last updated 6 years ago

Was this helpful?

switchBackTo is a special query parameter used in the method to determine whether to switch to the default app (currently app-switcher) or the app specified as the value for this parameter.

exit()