smartlook-react-native-wrapper

React native wrapper for Smartlook SDK

Usage no npm install needed!

<script type="module">
  import smartlookReactNativeWrapper from 'https://cdn.skypack.dev/smartlook-react-native-wrapper';
</script>

README

README

smartlook-react-native-wrapper

smartlook-react-native-wrapper

Table of contents

Namespaces

Variables

Functions

Variables

SmartlookSensitiveComponent

SmartlookSensitiveComponent: ForwardRefExoticComponent<SmartlookSensitiveComponentProps & RefAttributes<View>>

summary SmartlookSensitiveComponent can be used to wrap the component which should be marked as sensitive or vice versa not sensitive. Just be sure that you are not passing functional components as children! Eg. wrap it to React.forwardRef first.

example

<SmartlookSensitiveComponent isSensitive={true}>
    <Button title="Blacklisted button" />
</SmartlookSensitiveComponent>
Defined in

SmartlookSensitiveComponent.tsx:22

Functions

useSmartlookSensitiveRef

useSmartlookSensitiveRef<T>(isSensitive?): React.MutableRefObject<T | null>

summary custom hook designed to replace useRef. Use the isSensitive parameter to explicitly control the view sensitivity.

example

import { WebView } from 'react-native-webview';
import { useSmartlookSensitiveRef } from 'smartlook-react-native-wrapper';

function MyScreen({ isWebViewSensitive = false }) {
    const ref = useSmartlookSensitiveRef<WebView>(isWebViewSensitive);

    return <WebView ref={ref} source={{ html: "docs." }} />;
}
Type parameters
Name
T
Parameters
Name Type Default value
isSensitive boolean true
Returns

React.MutableRefObject<T | null>

Defined in

hooks/useSmartlookSensitiveRef.ts:21

Enums

Smartlook Event Tracking Mode

smartlook-react-native-wrapper / Smartlook / EventTrackingMode

Enumeration: EventTrackingMode

Smartlook.EventTrackingMode

Table of contents

Enumeration members

Enumeration members

FullTracking

FullTracking = "FULL_TRACKING"

Default state. SDK tracks all automatically detected events along with all user defined events.

Defined in

Smartlook.ts:427


IgnoreNavigationInteraction

IgnoreNavigationInteraction = "IGNORE_NAVIGATION_INTERACTION"

Disables automatically detected navigation events. User defined ones are still being sent.

Defined in

Smartlook.ts:435


IgnoreRageClicks

IgnoreRageClicks = "IGNORE_RAGE_CLICKS"

Disables automatic detection and tracking of rage click events.

Defined in

Smartlook.ts:439


IgnoreUserInteraction

IgnoreUserInteraction = "IGNORE_USER_INTERACTION"

Disables automatically detected selector (click on a View), focus, touch, gesture and keyboard events.

Defined in

Smartlook.ts:431


NoTracking

NoTracking = "NO_TRACKING"

No automatically detected events are tracked. Only user defined events are still tracked.

Defined in

Smartlook.ts:443

Smartlook Rendering Mode

smartlook-react-native-wrapper / Smartlook / RenderingMode

Enumeration: RenderingMode

Smartlook.RenderingMode

Table of contents

Enumeration members

Enumeration members

Native

Native = "native"

Defined in

Smartlook.ts:418


NoRendering

NoRendering = "no_rendering"

Defined in

Smartlook.ts:419


Wireframe

Wireframe = "wireframe"

Defined in

Smartlook.ts:420

Smartlook Sensitivity Type

smartlook-react-native-wrapper / Smartlook / SensitivityType

Enumeration: SensitivityType

Smartlook.SensitivityType

Table of contents

Enumeration members

Enumeration members

Blacklisted

Blacklisted = 0

Defined in

Smartlook.ts:447


Whitelisted

Whitelisted = 1

Defined in

Smartlook.ts:448

Smartlook View State

smartlook-react-native-wrapper / Smartlook / ViewState

Enumeration: ViewState

Smartlook.ViewState

Table of contents

Enumeration members

Enumeration members

Enter

Enter = "enter"

Defined in

Smartlook.ts:413


Exit

Exit = "exit"

Defined in

Smartlook.ts:414

Interfaces

Smartlook Setup Options

smartlook-react-native-wrapper / Smartlook / SetupOptions

Interface: SetupOptions

Smartlook.SetupOptions

Table of contents

Properties

Properties

fps

Optional fps: number

Defined in

Smartlook.ts:391


smartlookAPIKey

smartlookAPIKey: string

Defined in

Smartlook.ts:390


startNewSession

Optional startNewSession: boolean

Defined in

Smartlook.ts:392


startNewSessionAndUser

Optional startNewSessionAndUser: boolean

Defined in

Smartlook.ts:393

Modules

Smartlook

smartlook-react-native-wrapper / Smartlook

Namespace: Smartlook

The main Smartlook SDK wrapper.

Table of contents

Enumerations
Interfaces
1) Setup Functions
2) User Functions
3) Recording Functions
4) Timed events Functions
5) Events Functions
7) Sensitive views Functions
8) Dashboard urls Functions
9) Other Functions

1) Setup Functions

setup

setup(optionsOrAPIKey): void

Setup/initialize Smartlook SDK. This method DOESN'T start the recording (@see Smartlook.startRecording())

Parameters
Name Type
optionsOrAPIKey string | SetupOptions
Returns

void

Defined in

Smartlook.ts:45


setupAndStartRecording

setupAndStartRecording(optionsOrAPIKey): void

Setup and start Smartlook SDK recording.

Parameters
Name Type
optionsOrAPIKey string | SetupOptions
Returns

void

Defined in

Smartlook.ts:61


2) User Functions

setReferrer

setReferrer(referrer, source): void

Set a custom referrer.

summary When an application is installed from the Google Play Store, Smartlook SDK automatically tracks install referrer. A custom referrer can also be set by using this function.

Parameters
Name Type
referrer string
source string
Returns

void

Defined in

Smartlook.ts:302


setUserIdentifier

setUserIdentifier(userIdentifier, userProperties?): void

Sets a user identifier with optional dictionary of user properties

Parameters
Name Type
userIdentifier string
userProperties Object
Returns

void

Defined in

Smartlook.ts:74


3) Recording Functions

isRecording

isRecording(): Promise<boolean>

Returns current recording state

Returns

Promise<boolean>

A promise fulfilled by current recording state boolean

Defined in

Smartlook.ts:104


startRecording

startRecording(): void

Starts recording

Returns

void

Defined in

Smartlook.ts:85


stopRecording

stopRecording(): void

Stops recording

Returns

void

Defined in

Smartlook.ts:94


4) Timed events Functions

cancelTimedCustomEvent

cancelTimedCustomEvent(name, reason, eventProperties?): void

Cancels a timed event.

summary In case a given action failed this function is called instead of stopTimedCustomEvent.

Parameters
Name Type Description
name string -
reason string reason of failure
eventProperties Dictionary<string> properties are merged with the properties set in the startTimedCustomEvent
Returns

void

Defined in

Smartlook.ts:150


startTimedCustomEvent

startTimedCustomEvent(eventName, eventProperties?): Promise<string>

Starts a timed event.

summary Timed events can be used for measuring duration of any time-sensitive or long-running actions in the application. This will not send out any events but will return a Promise which will resolve with unique eventId that needs to be stored, and it is then used to stop/cancel a custom timed event.

Parameters
Name Type
eventName string
eventProperties Dictionary<string>
Returns

Promise<string>

A promise fulfilled by unique eventId

Defined in

Smartlook.ts:122


stopTimedCustomEvent

stopTimedCustomEvent(eventId, eventProperties?): void

Stops a timed event.

Parameters
Name Type Description
eventId string eventId obtained from startTimedCustomEvent
eventProperties Dictionary<string> properties are merged with the properties set in the startTimedCustomEvent
Returns

void

Defined in

Smartlook.ts:136


5) Events Functions

removeAllGlobalEventProperties

removeAllGlobalEventProperties(): void

Returns

void

Defined in

Smartlook.ts:243


removeGlobalEventProperty

removeGlobalEventProperty(key): void

Parameters
Name Type
key string
Returns

void

Defined in

Smartlook.ts:250


setEventTrackingMode

setEventTrackingMode(eventTrackingMode): void

Set event tracking mode.

summary It can be beneficial to disable some automatically detected events due to security or usability reasons. This can be done using event tracking modes

Parameters
Name Type
eventTrackingMode EventTrackingMode
Returns

void

Defined in

Smartlook.ts:336


setEventTrackingModes

setEventTrackingModes(eventTrackingModes): void

Set event tracking modes.

summary It can be beneficial to disable some automatically detected events due to security or usability reasons. This can be done using event tracking modes

Parameters
Name Type
eventTrackingModes EventTrackingMode[]
Returns

void

Defined in

Smartlook.ts:350


setGlobalEventProperties

setGlobalEventProperties(properties, immutable?): void

Parameters
Name Type Default value
properties Object undefined
immutable boolean false
Returns

void

Defined in

Smartlook.ts:257


setGlobalEventProperty

setGlobalEventProperty(key, value, immutable?): void

Parameters
Name Type Default value
key string undefined
value string undefined
immutable boolean false
Returns

void

Defined in

Smartlook.ts:264


trackCustomEvent

trackCustomEvent(name, properties?): void

Tracks custom event.

Parameters
Name Type
name string
properties Object
Returns

void

Defined in

Smartlook.ts:161


trackNavigationEvent

trackNavigationEvent(screenName, viewState): void

Tracks navigation event.

Parameters
Name Type
screenName string
viewState ViewState
Returns

void

Defined in

Smartlook.ts:172


7) Sensitive views Functions

registerBlacklistedView

registerBlacklistedView(ref): void

Parameters
Name Type
ref ComponentOrHandle
Returns

void

Defined in

Smartlook.ts:181


registerWhitelistedView

registerWhitelistedView(ref): void

Parameters
Name Type
ref ComponentOrHandle
Returns

void

Defined in

Smartlook.ts:205


setViewIsSensitive

setViewIsSensitive(ref, isSensitive): void

Parameters
Name Type
ref ComponentOrHandle
isSensitive boolean
Returns

void

Defined in

Smartlook.ts:229


unregisterBlacklistedView

unregisterBlacklistedView(ref): void

Parameters
Name Type
ref ComponentOrHandle
Returns

void

Defined in

Smartlook.ts:193


unregisterWhitelistedView

unregisterWhitelistedView(ref): void

Parameters
Name Type
ref ComponentOrHandle
Returns

void

Defined in

Smartlook.ts:217


8) Dashboard urls Functions

enableCrashlytics

enableCrashlytics(enabled): void

Parameters
Name Type
enabled boolean
Returns

void

Defined in

Smartlook.ts:309


getDashboardSessionUrl

getDashboardSessionUrl(withCurrentTimestamp?): Promise<string>

Returns a URL leading to the Smartlook Dashboard for a currently recorded session.

Parameters
Name Type Default value Description
withCurrentTimestamp boolean false If withCurrentTimestamp is set to true link it will include information about the current recording timestamp. This will ensure that the player will start playing the session at the moment when getDashboardSessionUrl was called.
Returns

Promise<string>

A promise fulfilled by a Smartlook Dashboard URL

Defined in

Smartlook.ts:279


getDashboardVisitorUrl

getDashboardVisitorUrl(): Promise<string>

A URL leading to the Smartlook Dashboard for a currently recorded visitor.

Returns

Promise<string>

A promise fulfilled by a Smartlook Dashboard URL

Defined in

Smartlook.ts:289


registerIntegrationListener

registerIntegrationListener(dashboardSessionUrlCallback, dashboardVisitorUrlCallback): void

Parameters
Name Type
dashboardSessionUrlCallback (url: string) => void
dashboardVisitorUrlCallback (url: string) => void
Returns

void

Defined in

Smartlook.ts:362


unregisterIntegrationListener

unregisterIntegrationListener(): void

Returns

void

Defined in

Smartlook.ts:382


9) Other Functions

resetSession

resetSession(resetUser): void

Parameters
Name Type
resetUser boolean
Returns

void

Defined in

Smartlook.ts:316


setRenderingMode

setRenderingMode(renderingMode): void

Parameters
Name Type
renderingMode RenderingMode
Returns

void

Defined in

Smartlook.ts:323