> For the complete documentation index, see [llms.txt](https://api.lampix.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.lampix.co/application-development/lampixjs/api/switchtoapp.md).

# 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

```javascript
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

`switchBackTo` is a special query parameter used in the [`exit()`](https://github.com/lampix-org/lampixjs-core/tree/aae985faf1cdc0c2159f49817193a66853c0eb5d/docs/app-dev/lampixjs/api/exit.md) method to determine whether to switch to the default app (currently `app-switcher`) or the app specified as the value for this parameter.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api.lampix.co/application-development/lampixjs/api/switchtoapp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
