Skip to content

stock42/stock42-react-native-lib

Repository files navigation

Stock42 logo

Stock42 React Native

Platform NPM Badge

PRs Welcome

Official lib for works with Stock42 Services.

Installation

$ npm install stock42-react-native-lib --save

Stock42 React Native lib Analytics

Initializing

First step: get a valid applicationToken from Stock42. Register a new tenant and create a new application.

import { Stock42 } from 'stock42-react-native-lib'

try {
	const { track, screenshot } = await Stock42({
			appVersion: '1.0',
			appName: 'Stock42Test',
			userAgent: 'stock42agent',
			applicationToken: 'bd23a6fb-02e6-4ac6-8e5c-2aa28bd83db2-FV2AH3',
			deviceId: '1',
		})
} catch (err) {
	console.info('Fatal Hit Errors: ', err)
}

Sending hits

	track({
		eventName: 'custom',
		screenName: 'home',
		functionName: `functionForSomeOne`,
		data: {
			msg: 'random msg',
		},
	})

Sending screenshot

screenshot({
			screenName: 'screentesting',
			base64:
				'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACClBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKDgUBAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAtEQcFFx4HAwEAAAArEAcCCAsAAAAiDQUBBQYAAAAEAgEBBAYnNxI2TBktPxQTGwkcJw1qlTCEuzx1ozJxnjBxnjFKaCENEgYMEAVrlzGJwT4/XykYQkgYR08lSTZKaydObSEAAAAyRxeNx0BdgikJICYce6UnpdwknNEab5UlTT8fLA4RBgNVdiaOyUE2TRgIBwkWHyMNPlMgh7QqreYkmc0SRloBAwMTBwNVIw5kjC2Jwj8hMA1paGrNzcxlY2ISHiQTV3Uno9kno9gPPVE8Fgl5MRRijS6Hvz4bJwuFhIb////6+vq6ubkuLy8NQVcijLoEEBZWIA6NNhZYfSiHwD4cKQuEg4Xn5+dHR0cPBQEdY4Iop90LLTxQHg2uQBtDVRx7en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Si4A6hcRdPJCNZUAAAAASUVORK5CYII=',
		})

Run Test

$ npx tsx test/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published