For further info visit https://smartlook.github.io/docs/sdk/react-native/.
smartlook-react-native-wrapper / Smartlook
The main Smartlook SDK wrapper.
- removeAllGlobalEventProperties
- removeGlobalEventProperty
- setEventTrackingMode
- setEventTrackingModes
- setGlobalEventProperties
- setGlobalEventProperty
- trackCustomEvent
- trackNavigationEvent
- registerBlacklistedView
- registerWhitelistedView
- setViewIsSensitive
- unregisterBlacklistedView
- unregisterWhitelistedView
- enableCrashlytics
- getDashboardSessionUrl
- getDashboardVisitorUrl
- registerIntegrationListener
- unregisterIntegrationListener
▸ setup(optionsOrAPIKey
: SetupOptions | string): void
Setup/initialize Smartlook SDK. This method DOESN'T start the recording (@see Smartlook.startRecording())
Name | Type |
---|---|
optionsOrAPIKey |
SetupOptions | string |
Returns: void
Defined in: Smartlook.ts:44
▸ setupAndStartRecording(optionsOrAPIKey
: SetupOptions | string): void
Setup and start Smartlook SDK recording.
Name | Type |
---|---|
optionsOrAPIKey |
SetupOptions | string |
Returns: void
Defined in: Smartlook.ts:67
▸ setReferrer(referrer
: string, source
: string): 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.
Name | Type |
---|---|
referrer |
string |
source |
string |
Returns: void
Defined in: Smartlook.ts:349
▸ setUserIdentifier(userIdentifier
: string, userProperties?
: {}): void
Sets a user identifier with optional dictionary of user properties
Name | Type | Default value |
---|---|---|
userIdentifier |
string | - |
userProperties |
object | {} |
Returns: void
Defined in: Smartlook.ts:88
▸ isRecording(): Promise<boolean>
Returns current recording state
Returns: Promise<boolean>
A promise fulfilled by current recording state boolean
Defined in: Smartlook.ts:121
▸ startRecording(): void
Starts recording
Returns: void
Defined in: Smartlook.ts:100
▸ stopRecording(): void
Stops recording
Returns: void
Defined in: Smartlook.ts:110
▸ cancelTimedCustomEvent(name
: string, reason
: string, eventProperties?
: Dictionary<string>): void
Cancels a timed event.
summary
In case a given action failed this function is called instead of stopTimedCustomEvent.
Name | Type | Default value | 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:179
▸ startTimedCustomEvent(eventName
: string, eventProperties?
: Dictionary<string>): 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.
Name | Type | Default value |
---|---|---|
eventName |
string | - |
eventProperties |
Dictionary<string> | {} |
Returns: Promise<string>
A promise fulfilled by unique eventId
Defined in: Smartlook.ts:143
▸ stopTimedCustomEvent(eventId
: string, eventProperties?
: Dictionary<string>): void
Stops a timed event.
Name | Type | Default value | 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:161
▸ removeAllGlobalEventProperties(): void
Returns: void
Defined in: Smartlook.ts:282
▸ removeGlobalEventProperty(key
: string): void
Name | Type |
---|---|
key |
string |
Returns: void
Defined in: Smartlook.ts:290
▸ setEventTrackingMode(eventTrackingMode
: 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
Name | Type |
---|---|
eventTrackingMode |
EventTrackingMode |
Returns: void
Defined in: Smartlook.ts:387
▸ setEventTrackingModes(eventTrackingModes
: EventTrackingMode[]): 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
Name | Type |
---|---|
eventTrackingModes |
EventTrackingMode[] |
Returns: void
Defined in: Smartlook.ts:402
▸ setGlobalEventProperties(properties
: {}, immutable?
: boolean): void
Name | Type | Default value |
---|---|---|
properties |
object | - |
immutable |
boolean | false |
Returns: void
Defined in: Smartlook.ts:300
▸ setGlobalEventProperty(key
: string, value
: string, immutable?
: boolean): void
Name | Type | Default value |
---|---|---|
key |
string | - |
value |
string | - |
immutable |
boolean | false |
Returns: void
Defined in: Smartlook.ts:308
▸ trackCustomEvent(name
: string, properties?
: {}): void
Tracks custom event.
Name | Type | Default value |
---|---|---|
name |
string | - |
properties |
object | {} |
Returns: void
Defined in: Smartlook.ts:194
▸ trackNavigationEvent(screenName
: string, viewState
: ViewState): void
Tracks navigation event.
Name | Type |
---|---|
screenName |
string |
viewState |
ViewState |
Returns: void
Defined in: Smartlook.ts:206
▸ registerBlacklistedView(ref
: ComponentOrHandle): void
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns: void
Defined in: Smartlook.ts:216
▸ registerWhitelistedView(ref
: ComponentOrHandle): void
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns: void
Defined in: Smartlook.ts:242
▸ setViewIsSensitive(ref
: ComponentOrHandle, isSensitive
: boolean): void
Name | Type |
---|---|
ref |
ComponentOrHandle |
isSensitive |
boolean |
Returns: void
Defined in: Smartlook.ts:267
▸ unregisterBlacklistedView(ref
: ComponentOrHandle): void
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns: void
Defined in: Smartlook.ts:229
▸ unregisterWhitelistedView(ref
: ComponentOrHandle): void
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns: void
Defined in: Smartlook.ts:255
▸ enableCrashlytics(enabled
: boolean): void
Name | Type |
---|---|
enabled |
boolean |
Returns: void
Defined in: Smartlook.ts:357
▸ getDashboardSessionUrl(withCurrentTimestamp?
: boolean): Promise<string>
Returns a URL leading to the Smartlook Dashboard for a currently recorded session.
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:324
▸ 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:335
▸ registerIntegrationListener(dashboardSessionUrlCallback
: (url
: string) => void, dashboardVisitorUrlCallback
: (url
: string) => void): void
Name | Type |
---|---|
dashboardSessionUrlCallback |
(url : string) => void |
dashboardVisitorUrlCallback |
(url : string) => void |
Returns: void
Defined in: Smartlook.ts:416
▸ unregisterIntegrationListener(): void
Returns: void
Defined in: Smartlook.ts:437
▸ resetSession(resetUser
: boolean): void
Name | Type |
---|---|
resetUser |
boolean |
Returns: void
Defined in: Smartlook.ts:365
▸ setRenderingMode(renderingMode
: RenderingMode): void
Name | Type |
---|---|
renderingMode |
RenderingMode |
Returns: void
Defined in: Smartlook.ts:373
• Const
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
▸ useSmartlookSensitiveRef<T>(isSensitive?
: boolean): 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." }} />;
}
Name |
---|
T |
Name | Type | Default value |
---|---|---|
isSensitive |
boolean | true |
Returns: React.MutableRefObject<T | null
>
Defined in: hooks/useSmartlookSensitiveRef.ts:21
smartlook-react-native-wrapper / Smartlook / EventTrackingMode
Smartlook.EventTrackingMode
• FullTracking: = "FULL_TRACKING"
Default state. SDK tracks all automatically detected events along with all user defined events.
Defined in: Smartlook.ts:468
• IgnoreNavigationInteraction: = "IGNORE_NAVIGATION_INTERACTION"
Disables automatically detected navigation events. User defined ones are still being sent.
Defined in: Smartlook.ts:476
• IgnoreRageClicks: = "IGNORE_RAGE_CLICKS"
Disables automatic detection and tracking of rage click events.
Defined in: Smartlook.ts:480
• IgnoreUserInteraction: = "IGNORE_USER_INTERACTION"
Disables automatically detected selector (click on a View), focus, touch, gesture and keyboard events.
Defined in: Smartlook.ts:472
• NoTracking: = "NO_TRACKING"
No automatically detected events are tracked. Only user defined events are still tracked.
Defined in: Smartlook.ts:484
smartlook-react-native-wrapper / Smartlook / RenderingMode
Smartlook.RenderingMode
• Native: = "native"
Defined in: Smartlook.ts:459
• NoRendering: = "no_rendering"
Defined in: Smartlook.ts:460
• Wireframe: = "wireframe"
Defined in: Smartlook.ts:461
smartlook-react-native-wrapper / Smartlook / SensitivityType
Smartlook.SensitivityType
• Blacklisted: = 0
Defined in: Smartlook.ts:488
• Whitelisted: = 1
Defined in: Smartlook.ts:489
smartlook-react-native-wrapper / Smartlook / ViewState
Smartlook.ViewState
• Enter: = "enter"
Defined in: Smartlook.ts:454
• Exit: = "exit"
Defined in: Smartlook.ts:455
smartlook-react-native-wrapper / Smartlook / SetupOptions
Smartlook.SetupOptions
- _reactNativeVersion
- _smartlookPluginVersion
- fps
- smartlookAPIKey
- startNewSession
- startNewSessionAndUser
• Optional
_reactNativeVersion: string
Defined in: Smartlook.ts:449
• Optional
_smartlookPluginVersion: string
Defined in: Smartlook.ts:450
• Optional
fps: number
Defined in: Smartlook.ts:446
• smartlookAPIKey: string
Defined in: Smartlook.ts:445
• Optional
startNewSession: boolean
Defined in: Smartlook.ts:447
• Optional
startNewSessionAndUser: boolean
Defined in: Smartlook.ts:448