# @execonline-inc/firebase-analytics-wrapper

> This package abstracts the use of the Firebase analytics package primarily to prevent compilation errors for non-mobile platforms.

Latest version **2.1.0** (published 2022-11-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @execonline-inc/firebase-analytics-wrapper
pnpm add @execonline-inc/firebase-analytics-wrapper
yarn add @execonline-inc/firebase-analytics-wrapper
bun add @execonline-inc/firebase-analytics-wrapper
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2022-11-09 |
| First published | 2021-07-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Patrick Rebsch |
| Maintainers | kofno |

## Links

- npm: https://www.npmjs.com/package/@execonline-inc/firebase-analytics-wrapper
- Repository: https://github.com/execonline-inc/firebase-analytics-wrapper
- Homepage: https://github.com/execonline-inc/firebase-analytics-wrapper#readme
- Issues: https://github.com/execonline-inc/firebase-analytics-wrapper/issues
- npm.io page: https://npm.io/package/@execonline-inc/firebase-analytics-wrapper

## Dependencies (6)

- [maybeasy](https://npm.io/package/maybeasy.md) ^5.0.0
- [taskarian](https://npm.io/package/taskarian.md) ^5.3.0
- [@kofno/piper](https://npm.io/package/@kofno/piper.md) ^4.3.0
- [@execonline-inc/logging](https://npm.io/package/@execonline-inc/logging.md) ^6.3.0
- [@react-native-firebase/app](https://npm.io/package/@react-native-firebase/app.md) ^12.9.3
- [@react-native-firebase/analytics](https://npm.io/package/@react-native-firebase/analytics.md) ^12.9.3

## Recent versions

- 2.1.0 (latest) — 2022-11-09
- 2.0.2 — 2022-08-02
- 2.0.1 — 2021-08-17
- 2.0.0 — 2021-07-22
- 1.1.0 — 2021-07-14
- 1.0.0 — 2021-07-12

## README

# firebase-analytics-wrapper

This package abstracts the use of the Firebase analytics package primarily to prevent compilation errors for non-mobile platforms.

## Why?

The web requires the use of standard Google Analytics, but that is not compatible with mobile apps, where Google's Firebase Analytics must be used instead.

Unfortunately, the reference of the Firebase Analytics package by any web code causes compilation errors during bundling. The bundler must include the package during compilation for the chance that it is referenced at runtime, but there is some incompatible code for the package import which the bundler cannot resolve.

Since static imports are required, there needs to be some abstraction between the use of the Firebase analytics package and its implementation so that reference of the package does not cause compilation or runtime errors for the platform(s) where the code does not need to be executed.

## How?

Abstracting the implementations within a JS package allows such decoupling of the implementations where each build can reference only the implementation relevant to its target platform, avoiding any unintended reference on other platforms.

This decoupling is achieved with the `react-native` (and `browser` when relevant) fields in the `package.json` file which reference separate web/mobile implementations that can conform to a singular interface.

Currently, this package is specific to the mobile implementation using Firebase, but it could be updated to add a web implementation.

---
_Source: https://npm.io/package/@execonline-inc/firebase-analytics-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
