# @laerdal/navigation

> Navigation for MyLaerdal Portal and friends

Latest version **3.2.8** (published 2025-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @laerdal/navigation
pnpm add @laerdal/navigation
yarn add @laerdal/navigation
bun add @laerdal/navigation
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.8 |
| Published | 2025-02-13 |
| First published | 2022-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 5.4 MB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | gkhinchakadze, laerdal_petehl, amarpreet.singh, sagarsingour, laerdal-bb |

## Links

- npm: https://www.npmjs.com/package/@laerdal/navigation
- npm.io page: https://npm.io/package/@laerdal/navigation

## Dependencies (6)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [i18next](https://npm.io/package/i18next.md) ^22.4.14
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^3.1.2
- [react-helmet](https://npm.io/package/react-helmet.md) ^6.1.0
- [react-i18next](https://npm.io/package/react-i18next.md) ^12.2.0
- [focus-trap-react](https://npm.io/package/focus-trap-react.md) ^10.0.0

## Recent versions

- 3.2.8 (latest) — 2025-02-13
- 4.0.0-dev.20260129.4 (dev) — 2026-01-29
- 4.0.0-feature.20260129.3 (feature) — 2026-01-29
- 3.2.8-feature.20260129.2 — 2026-01-29
- 3.2.8-feature.20260129.1 — 2026-01-29
- 3.2.8-feature.20250213.2 — 2025-02-13
- 3.2.8-dev.20250213.1 — 2025-02-13
- 3.2.7 — 2024-11-12
- 3.2.7-feature.20241112.3 — 2024-11-12
- 3.2.7-dev.20241112.1 — 2024-11-12
- 3.2.6 — 2024-10-11
- 3.2.6-feature.20241011.5 — 2024-10-11
- 3.2.6-feature.20241011.4 — 2024-10-11
- 3.2.6-dev.20241011.3 — 2024-10-11
- 3.2.6-feature.20241011.2 — 2024-10-11
- … 254 more at https://npm.io/package/@laerdal/navigation/versions

## README

# MyLaerdal global navigation

This package builds to a single .js file that can be used to add global navigation / service switcher to all Laerdal web applications.

[![Build Status](https://dev.azure.com/enable-laerdal/MyLaerdal%20Portal/_apis/build/status/MyLaerdal%20Navigation?branchName=master)](https://dev.azure.com/enable-laerdal/MyLaerdal%20Portal/_build/latest?definitionId=55&branchName=master)

Questions? Go find Thomas Kalve or Erik J. Sandal.

## How to build and test locally

1. Clone the repository: `git clone git@bitbucket.org:laerdal/portal.git`
2. Switch to the navigation package: `cd packages/navigation`
3. Install dependencies: `yarn`
4. Build the navigation package: `yarn build`
5. Serve the current directory on localhost: `serve .`
6. Access index.html on `http://localhost:5000`

If you are missing `serve`, run `yarn global add serve`. If you are missing yarn, visit the [yarn install page](https://classic.yarnpkg.com/en/docs/install/).

## Embed into an application

1. Serve `dist/globalNav.js` on an appropriate location on the interwebz (Its temporarily hosted on: https://myportal-test.azurewebsites.net/globalNav.js)
2. Add the script to your webpage:

```
<script src="https://example.com/globalNav/globalNav.js" />
```

3. Use the methods on `window.globalNav` to show, hide or toggle the switcher:

```
<button onClick="window.globalNav.show()">Show</button>
<button onClick="window.globalNav.hide()">Hide</button>
<button onClick="window.globalNav.toggle()">Toggle</button>
```

4. Nice!

## Integration with SAP CDC

The globalNav script will look for the Gigya Web SDK and bind to the gigya events, ie. onLogin and onLogout.

---
_Source: https://npm.io/package/@laerdal/navigation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
