@goplayerzero/sdk-react-native
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

PlayerZero React Native SDK

Installation Instructions

  1. Install the sdk

with npm

npm i @goplayerzero/sdk-react-native --save

with yarn

yarn add @goplayerzero/sdk-react-native

  1. Install pods (only necessary if using iOS without Expo)

npx pod-install

  1. Add the following to your App.js file
import {PlayerZero, PlayerZeroWrapper} from "@goplayerzero/sdk-react-native";

export default function App() {
  PlayerZero.init('<your api token here>')
  return (
      <PlayerZeroWrapper>
	{/*Rest of app here*/}
      </PlayerZeroWrapper>
  );
}

NOTE: If you don't want to add the PlayerZeroWrapper, you can simply call our convenience function withPlayerZeroWrapper before registering the app like registerRootComponent(withPlayerZeroWrapper(App));

  1. Upload a test report!

Long pressing anywhere on the screen for 2 seconds and then releasing will open the upload modal. You can leave a comment and upload the report.


Include additional data (optional):

  1. Instrument identity
PlayerZero.identify(
  'userId',
  {
    name: 'Billy Joel',
    email: 'billy@joel.com',
    group: 'Pied Piper'
  }
)
  1. Add a FullStory Session Link
FullStory.getCurrentSessionURL().then((url) => {
  PlayerZero.addReplayLink({"fullstoryUrl": url})
});

Note: this will be null if called before the Fullstory session is active.

  1. Track additional events
PlayerZero.track("<event>", metadata?: Record<string, unknown>)

Package Sidebar

Install

npm i @goplayerzero/sdk-react-native

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

322 kB

Total Files

150

Last publish

Collaborators

  • goplayerzero