# @kiwicom/smart-faq-sidebar

> ## Installation

Latest version **13.0.0** (published 2022-09-28) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @kiwicom/smart-faq-sidebar
pnpm add @kiwicom/smart-faq-sidebar
yarn add @kiwicom/smart-faq-sidebar
bun add @kiwicom/smart-faq-sidebar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 13.0.0 |
| Published | 2022-09-28 |
| First published | 2019-09-23 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 48.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | kiwi.com |
| Maintainers | jakubzaba, oreqizer, robincsl_kiwi, kiwicom.platform, dinodsaurus, mainframev |

## Links

- npm: https://www.npmjs.com/package/@kiwicom/smart-faq-sidebar
- npm.io page: https://npm.io/package/@kiwicom/smart-faq-sidebar

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^9.0.0
- [history](https://npm.io/package/history.md) 4.10.1
- [react-relay](https://npm.io/package/react-relay.md) 13.2.0
- [relay-runtime](https://npm.io/package/relay-runtime.md) 13.2.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.7.6
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^5.1.2
- [@kiwicom/smart-faq-core](https://npm.io/package/@kiwicom/smart-faq-core.md) 13.0.0

## Recent versions

- 13.0.0 (latest) — 2022-09-28
- 12.0.11 — 2022-09-08
- 12.0.10 — 2022-08-04
- 12.0.9 — 2022-07-06
- 12.0.8 — 2022-06-17
- 12.0.7 — 2022-06-16
- 12.0.6 — 2022-06-15
- 12.0.5 — 2022-05-03
- 12.0.4 — 2022-04-06
- 12.0.3 — 2022-03-25
- 12.0.2 — 2022-03-24
- 12.0.1 — 2022-03-16
- 12.0.0 — 2022-03-14
- 11.7.0 — 2021-10-18
- 11.6.0 — 2021-08-19
- … 137 more at https://npm.io/package/@kiwicom/smart-faq-sidebar/versions

## README

# Helpcenter Sidebar

## Installation

```
yarn add @kiwicom/smart-faq-sidebar
```
Helpcenter Sidebar requires Nitro & Orbit as peer dependencies with the corresponding contexts mounted on a parent level.

## Usage

The npm package exports 2 react components. An example usage:

```jsx
import { HelpSidebarDrawer, HelpSidebarApp } from '@kiwicom/smart-faq-sidebar';
import type { HelpSidebarDrawerProps, HelpSidebarAppProps } from '@kiwicom/smart-faq-sidebar';
import Loading from "@kiwicom/orbit-components/lib/Loading"

// Use a code-splitting tool to lazy load the HelpSidebarApp.
// This example uses next.js `dynamic`.
const LazyHelpSidebarApp = dynamic<SideBarProps>({
  loader: <Loading />,
  ssr: false,
});

// Depending on where you place this component in your React tree, 
// you might also want to wrap the drawer with <Portal>.
export default function HelpSidebar(props: HelpSidebarAppProps) {
  // Check whether the sidebar is being open via the url, 
  // i.e. the url includes the `?help` parameter.
  // The implementation of `useIsOpenViaRouter` is up to you,
  // this is just an example.
  const isOpenViaRouter = useIsOpenViaRouter()

  const isOpenViaPropOrRouter = props.isOpen || isOpenViaRouter

  return (
    // Unlike <HelpSidebarApp />, the drawer is not meant to be lazy loaded.
    // This is to ensure a smooth opening animation.
    <HelpSidebarDrawer isShown={isOpenViaPropOrRouter} onClose={() => props.onToggle(false)}>
      {isOpen && (
        <LazyHelpSidebarApp 
          isOpen={isOpenViaPropOrRouter}
          // You can open the sidebar directly on a specific article by 
          // providing the article ID.
          openArticle={props.openArticle}
          // (Optional) The sidebar will show a contextual Trip Info card
          // associated with the provided booking ID.
          // If no booking ID is provided and the user is logged in,
          // we fetch user's latest available booking.
          initialBookingId={props.initialBookingId}
          // (Optional) Disable Sentry logging. Sentry logging is enabled by default.
          disableSentry
          // For each emergency, we render <Alert type="warning' /> with the provided copy
          // on the sidebar's home screen.
          emergencies={props.emergencies}
          // The sidebar needs to be able to close itself programmatically.
          onToggle={props.onToggle}
        />
      )}
    </HelpSidebarDrawer>
  )
}
```

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