# @crqlar/expo-sdk

> An SDK for building hotel apps using Crqlar APIs and Expo.

Latest version **0.4.43** (published 2024-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @crqlar/expo-sdk
pnpm add @crqlar/expo-sdk
yarn add @crqlar/expo-sdk
bun add @crqlar/expo-sdk
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.43 |
| Published | 2024-11-26 |
| First published | 2023-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.0.0 |
| Dependencies | 56 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Author | crqlar |
| Maintainers | crqlar |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/@crqlar/expo-sdk
- Repository: http://www.crqlar.com
- Homepage: http://www.crqlar.com#readme
- Issues: http://www.crqlar.com/issues
- npm.io page: https://npm.io/package/@crqlar/expo-sdk

## Dependencies (56)

- [ws](https://npm.io/package/ws.md) 8.13.0
- [expo](https://npm.io/package/expo.md) ^52.0.0
- [uuid](https://npm.io/package/uuid.md) 9.0.0
- [axios](https://npm.io/package/axios.md) ^1.7.7
- [luxon](https://npm.io/package/luxon.md) 3.3.0
- [react](https://npm.io/package/react.md) 18.3.1
- [redux](https://npm.io/package/redux.md) 4.2.1
- [i18next](https://npm.io/package/i18next.md) 23.2.11
- [date-fns](https://npm.io/package/date-fns.md) 2.30.0
- [expo-font](https://npm.io/package/expo-font.md) ~13.0.1
- [react-dom](https://npm.io/package/react-dom.md) 18.3.1
- [expo-asset](https://npm.io/package/expo-asset.md) ~11.0.1
- [react-query](https://npm.io/package/react-query.md) ^3.39.3
- [react-redux](https://npm.io/package/react-redux.md) ^8.1.1
- [redux-thunk](https://npm.io/package/redux-thunk.md) 2.4.2
- [react-native](https://npm.io/package/react-native.md) 0.76.1
- [react-i18next](https://npm.io/package/react-i18next.md) ^13.0.2
- [text-encoding](https://npm.io/package/text-encoding.md) 0.7.0
- [@stomp/stompjs](https://npm.io/package/@stomp/stompjs.md) 7.0.0
- [expo-constants](https://npm.io/package/expo-constants.md) ~17.0.3
- [expo-status-bar](https://npm.io/package/expo-status-bar.md) ~2.0.0
- [react-native-web](https://npm.io/package/react-native-web.md) ~0.19.13
- [expo-image-picker](https://npm.io/package/expo-image-picker.md) ~16.0.1
- [@expo/vector-icons](https://npm.io/package/@expo/vector-icons.md) ^14.0.2
- [expo-notifications](https://npm.io/package/expo-notifications.md) ~0.29.7
- [expo-splash-screen](https://npm.io/package/expo-splash-screen.md) ~0.29.9
- [react-native-paper](https://npm.io/package/react-native-paper.md) 5.9.1
- [@cloudinary/url-gen](https://npm.io/package/@cloudinary/url-gen.md) 1.10.2
- [expo-linear-gradient](https://npm.io/package/expo-linear-gradient.md) ~14.0.1
- [react-native-screens](https://npm.io/package/react-native-screens.md) ~4.0.0
- [react-native-webview](https://npm.io/package/react-native-webview.md) 13.12.2
- [@tanstack/react-query](https://npm.io/package/@tanstack/react-query.md) ^4.33.0
- [react-native-calendars](https://npm.io/package/react-native-calendars.md) ^1.1299.0
- [@react-navigation/stack](https://npm.io/package/@react-navigation/stack.md) ^6.3.17
- [react-native-reanimated](https://npm.io/package/react-native-reanimated.md) ~3.16.1
- [@react-navigation/drawer](https://npm.io/package/@react-navigation/drawer.md) ^6.6.3
- [@react-navigation/native](https://npm.io/package/@react-navigation/native.md) ^6.1.7
- [react-native-phone-input](https://npm.io/package/react-native-phone-input.md) 1.3.6
- [react-native-url-polyfill](https://npm.io/package/react-native-url-polyfill.md) 2.0.0
- [react-native-vector-icons](https://npm.io/package/react-native-vector-icons.md) 10.0.0
- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) 4.1.1
- [@react-native-picker/picker](https://npm.io/package/@react-native-picker/picker.md) 2.9.0
- [@stripe/stripe-react-native](https://npm.io/package/@stripe/stripe-react-native.md) 0.38.6
- [@formidable-webview/webshell](https://npm.io/package/@formidable-webview/webshell.md) 2.6.0
- [react-native-gesture-handler](https://npm.io/package/react-native-gesture-handler.md) ~2.20.2
- [@react-navigation/bottom-tabs](https://npm.io/package/@react-navigation/bottom-tabs.md) ^6.5.7
- [react-native-get-random-values](https://npm.io/package/react-native-get-random-values.md) ~1.11.0
- [react-native-safe-area-context](https://npm.io/package/react-native-safe-area-context.md) 4.12.0
- [@expo/react-native-action-sheet](https://npm.io/package/@expo/react-native-action-sheet.md) 4.0.1
- [i18next-browser-languagedetector](https://npm.io/package/i18next-browser-languagedetector.md) 7.1.0
- [react-native-reanimated-carousel](https://npm.io/package/react-native-reanimated-carousel.md) ^3.3.2
- [react-native-country-picker-modal](https://npm.io/package/react-native-country-picker-modal.md) 2.0.0
- [@react-native-community/masked-view](https://npm.io/package/@react-native-community/masked-view.md) ^0.1.11
- [@react-native-community/datetimepicker](https://npm.io/package/@react-native-community/datetimepicker.md) 8.2.0
- [@react-native-async-storage/async-storage](https://npm.io/package/@react-native-async-storage/async-storage.md) 1.23.1
- [@babel/plugin-proposal-export-namespace-from](https://npm.io/package/@babel/plugin-proposal-export-namespace-from.md) 7.18.9

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.4.43 (latest) — 2024-11-26
- 0.4.42 — 2024-11-26
- 0.4.41 — 2024-11-16
- 0.4.40 — 2024-11-14
- 0.4.39 — 2024-09-06
- 0.4.38 — 2024-09-06
- 0.4.37 — 2024-09-06
- 0.4.36 — 2024-09-06
- 0.4.35 — 2024-09-06
- 0.4.34 — 2024-09-06
- 0.4.33 — 2024-09-06
- 0.4.32 — 2024-09-06
- 0.4.31 — 2024-06-04
- 0.4.30 — 2024-05-24
- 0.4.29 — 2024-05-24
- … 46 more at https://npm.io/package/@crqlar/expo-sdk/versions

## README

# @crqlar/expo-sdk

An SDK for building hotel apps using Crqlar APIs and Expo.

## Installation

```sh
yarn add @crqlar/expo-sdk
```

or

```sh
npm install @crqlar/expo-sdk
```

## Usage

```js

// Put this before App function in your App.tsx file
CrqlarSDK.initialize({
  publicKey: Constants.expoConfig?.extra?.publicKey,
  apiUrl: Constants.expoConfig?.extra?.apiUrl,
  wsUrl: Constants.expoConfig?.extra?.wsUrl,
  i18Config: {
    en: {
      translation: require('./assets/translations/en.json')
    },
    de: {
      translation: require('./assets/translations/de.json')
    }
  },
  paperProps: {
    theme: {
      fonts: {
        regular: { fontFamily: 'Arial' }
      }
    }
  } as any,
  customComponents: {
    text: props => <CustomText {...props} />,
    input: (props, ref) => <CustomInput {...props} ref={ref}/>,
    button: (props, ref) => <CustomButton {...props} ref={ref}/>,
  }
})

// With the SDK initialized, we can start using the app
export default function App() {
  const colorScheme = useColorScheme();
  const [fontsLoaded] = useFonts({
    "ExampleFont": require('./assets/fonts/ExampleFont.otf')
  })
  const [initializationDone, setInitializationDone] = useState(false);

  useEffect(() => {
    const init = async () => {
      CrqlarSDK.i18Config && (await initLocalization(CrqlarSDK.i18Config, 'en'));
      setInitializationDone(true);
    };
    init();
  }, []);

  if (!fontsLoaded || !initializationDone) {
    return null
  }

  return (
    <CrqlarApp>
      <Navigation colorScheme={colorScheme}/>
    </CrqlarApp>
  );
}


```

Configuration properties:

| Property | Explanation                                                                                                                                                                                                                                                              |
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `publicKey` | The public key provided to the SDK. It's used for API authentication and requests to the server.                                                                                                                                                                         |
| `apiUrl` | The base URL for all API calls. It's used by the SDK to connect to the server and perform operations.                                                                                                                                                                    |
| `wsUrl` | The URL for WebSocket communication. WebSockets provide full-duplex communication channels over a single TCP connection.                                                                                                                                                 |
| `i18Config` | Internationalization (i18n) configuration object. This is used for localization of your application, providing translations for the languages you will use. The translations are fetched from `*.json` files.                                                            |
| `paperProps` | The properties for the `react-native-paper` library, which is used for UI components in React Native. This particular configuration sets the theme's fonts.                                                                                                                |
| `regular`, `light`, `thin`, `medium`, `labelLarge`, `labelMedium`, `labelSmall` | Font configurations within the `paperProps` object. In this case, each is set to use the 'RotundaVariable-Regular' font family.                                                                                                                                          |
| `customComponents` | An object that defines custom React components. These components will replace the default components in the Paper library.                                                                                                                                               |
| `text`, `input`, `button` | These are custom components defined within `customComponents`. The `text` is a custom text component, `input` is a custom input component, and `button` is a custom button component. Each custom component takes props and, for the input and button components, a ref. |

This table explains the high-level concepts of each property. For a more in-depth explanation, you would need to consult
the CrqlarSDK documentation, as the specifics can vary based on implementation.

## Models

This is a brief explanation of most commonly used data models

| Interface Name                  | Description                                                                                        |
|---------------------------------|----------------------------------------------------------------------------------------------------|
| RestaurantReservation           | Represents one restaurant reservation.                                                             |
| RestaurantTable                 | Restaurant table information.                                                                      |
| CustomerGovernmentID            | ID info, such as passport, licence, etc.                                                           |
| RoomRate                        | Hotel reservation room rate, OTA.                                                                  |
| CustomFormPredefinedValue       | Predefined value for custom form option.                                                           |
| ServiceReservation              | Represents one service (eg. spa) reservation.                                                      |
| ServiceSector                   | Sector info - eg. spa, sports, rental.                                                             |
| ServiceValidityPeriod           | []TODO                                                                                             |
| AmountType                      | Represent some value, such as price, with detailed info like before tax, after tax, validity, etc. |
| BaseModel                       | Base model for all Crqlar types.                                                                   |
| CheckInInvoiceItem              | One invoice line.                                                                                  |
| LocalizedEmailTemplate          | []TODO                                                                                             |
| Media                           | Image or other media, with provider (storage) info.                                                |
| Comment                         |                                                                                                    |
| LocalizedContent                | Content which contains language code and generic JSON content.                                     |
| ProfileEmail                    | Detailed email info.                                                                               |
| Channel                         | Chat message channel.                                                                              |
| Customer                        | Basic profile info such as name, gender, birthday...                                               |
| ProfileAddress                  | Detailed address info.                                                                             |
| ReservationExtra                | Additional requests related to hotel reservation.                                                  |
| Total                           | Represents amount with currency code.                                                              |
| RatePlan                        | []TODO                                                                                             |
| Service                         | A service which can be booked.                                                                     |
| LocalizedText                   | Content which contains language code and text value for that language.                             |
| Plan                            | Weekly plan.                                                                                       |
| ProfilePreference               | Detailed profile preference with type and value.                                                   |
| BaseAuditableModel              | Extension of `BaseMode` which also contains date of modification.                                  |
| PostCategory                    | Category of app posts.                                                                             |
| Resource                        | Staff or facility related to `Service` and `ServiceReservation`.                                   |                                                                                                                 |
| RoomStay                        | One hotel room stay with check-in/out dates, room rates, room id, etc.                             |
| Post                            | App post.                                                                                          |
| GuestAuthClaims                 | Auth response which contains token and user info.                                                  |                                                                                                                |
| AdditionalGuestRequest          | Info about additional guests; used during check in.                                                |
| RestaurantSpecialEvent          | Marks that restaurant reservation is for some special event (eg. wedding, birthday)                |
| Page                            | Paging response holder with content.                                                               |
| Price                           | []TODO                                                                                             |
| PlanItem                        | One weekly planner item                                                                            |
| RoomType                        |                                                                                                    |
| ResGlobalInfo                   |                                                                                                    |
| StripeSetupIntent               |                                                                                                    |
| AvailabilityDates               |                                                                                                    |
| TaxRate                         |                                                                                                    |
| AuthRequest                     |                                                                                                    |
| Restaurant                      |                                                                                                    |
| Company                         |                                                                                                    |
| ProfilePhone                    | Detailed phone info.                                                                               |
| Participant                     |                                                                                                    |
| EmailTemplate                   |                                                                                                    |
| ServiceCategory                 | Category of `Service`                                                                              |
| Availability                    | Info about one availability slot for service or restaurant reservations                            |
| ResGuest                        |                                                                                                    |
| CorrespondenceMessage           | Chat message.                                                                                      |
| HotelReservation                | Holds all info about one hotel reservation.                                                        |
| Guest                           | App user                                                                                           |

## Services

Services are used for making CRQLAR API calls

| Service        | File                                                          |
|----------------|---------------------------------------------------------------|
| AuthService    | Login, Registration, Push token and other auth related calls. |
| CorrespondenceMessageService        | Get conversations and send messages.                          |
| CheckInService        | Send check in requests, check status, list extras.            |
| PostService        | Get posts list or post details.                               |
| PostCategoryService        | Get post categories or category details.                      |
| ProfileService        | Modify profile data.                                          |
| CustomFormService        | Read or submit custom forms.                                  |
| RestaurantService | List restaurants or check availability.                       |
| RestaurantReservationService           | Make restaurant reservations and check status.                |
| PlanService           | Get plan info and plan for specific date range.               |
| ServiceCategoryService           | Get info about service categories.                            |
| ServiceReservationService           | Make service (eg. spa) reservations and check status.         |
| ServicesService           | Get info about available services.                            |
| PushService           | Request permissions and subscribe for push notifications.     |
| StompService     | Handle web socket communication.                              |
| CloudinaryService     | Upload files                                                  |

## Components

[] Add component descriptions

## Utils

[] Add a list of util functions

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

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