React Native Piano Analytics
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
For bare React Native projects, you must ensure that you have installed and configured the expo
package before continuing.
npm install @pmu-tech/react-native-piano-analytics
Run npx pod-install
after installing the npm package.
You may want to give a try? Run example application in ./example
.
import * as PianoAnalytics from '@pmu-tech/react-native-piano-analytics';
function setConfiguration(collectionName: string, siteId: number): void
By default Piano Analytics will set "no-consent" mode.
type PrivacyMode = 'optin' | 'exempt' | 'no-storage' | 'no-consent' | 'optout';
// SET:
function privacySetMode(mode: PrivacyMode): void
// GET:
function privacyGetMode(): PrivacyMode
// SET USER:
function setUser(userId: string, category: string, enableStorage: boolean): void
// SET PRIVACY ID:
function setVisitorId(visitorId: string): void
// GET PRIVACY ID:
function getVisitorId(): string
// SET PRIVACY INCLUDE PROPERTY :
function privacyIncludeProperty(property: string, privacyModes?: string[], eventNames?: string[]): void
// SET PRIVACY INCLUDE PROPERTIES:
function privacyIncludeProperties(properties: [string], privacyModes?: string[], eventNames?: string[]): void
export type ClickEvents = "click.action" | "click.navigation" | "click.download" | "click.exit";
export type PageEvents = "page.display" | "com.display";
export type EventName = ClickEvents | PageEvents;
function sendEvent(eventName: EventName, params: Record<string, string>): void
Contributions are very welcome! Please refer to guidelines described in the contributing guide.