@goplayerzero/sdk-react-native
v0.1.0
Published
The official PlayerZero React Native SDK
Downloads
15
Maintainers
Readme
PlayerZero React Native SDK
Installation Instructions
- Install the sdk
with npm
npm i @goplayerzero/sdk-react-native --save
with yarn
yarn add @goplayerzero/sdk-react-native
- Install pods (only necessary if using iOS without Expo)
npx pod-install
- 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));
- 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):
- Instrument identity
PlayerZero.identify(
'userId',
{
name: 'Billy Joel',
email: '[email protected]',
group: 'Pied Piper'
}
)
- 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.
- Track additional events
PlayerZero.track("<event>", metadata?: Record<string, unknown>)