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
IgnoreNavigationInteraction
• IgnoreNavigationInteraction = "IGNORE_NAVIGATION_INTERACTION"
Disables automatically detected navigation events. User defined ones are still being sent.
Defined in
IgnoreRageClicks
• IgnoreRageClicks = "IGNORE_RAGE_CLICKS"
Disables automatic detection and tracking of rage click events.
Defined in
IgnoreUserInteraction
• IgnoreUserInteraction = "IGNORE_USER_INTERACTION"
Disables automatically detected selector (click on a View), focus, touch, gesture and keyboard events.
Defined in
NoTracking
• NoTracking = "NO_TRACKING"
No automatically detected events are tracked. Only user defined events are still tracked.
Defined in
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
NoRendering
• NoRendering = "no_rendering"
Defined in
Wireframe
• Wireframe = "wireframe"
Defined in
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
Whitelisted
• Whitelisted = 1
Defined in
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
Exit
• Exit = "exit"
Defined in
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
smartlookAPIKey
• smartlookAPIKey: string
Defined in
startNewSession
• Optional
startNewSession: boolean
Defined in
startNewSessionAndUser
• Optional
startNewSessionAndUser: boolean
Defined in
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
- removeAllGlobalEventProperties
- removeGlobalEventProperty
- setEventTrackingMode
- setEventTrackingModes
- setGlobalEventProperties
- setGlobalEventProperty
- trackCustomEvent
- trackNavigationEvent
7) Sensitive views Functions
- registerBlacklistedView
- registerWhitelistedView
- setViewIsSensitive
- unregisterBlacklistedView
- unregisterWhitelistedView
8) Dashboard urls Functions
- enableCrashlytics
- getDashboardSessionUrl
- getDashboardVisitorUrl
- registerIntegrationListener
- unregisterIntegrationListener
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
setupAndStartRecording
▸ setupAndStartRecording(optionsOrAPIKey
): void
Setup and start Smartlook SDK recording.
Parameters
Name | Type |
---|---|
optionsOrAPIKey |
string | SetupOptions |
Returns
void
Defined in
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
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
3) Recording Functions
isRecording
▸ isRecording(): Promise
<boolean
>
Returns current recording state
Returns
Promise
<boolean
>
A promise fulfilled by current recording state boolean
Defined in
startRecording
▸ startRecording(): void
Starts recording
Returns
void
Defined in
stopRecording
▸ stopRecording(): void
Stops recording
Returns
void
Defined in
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
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
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
5) Events Functions
removeAllGlobalEventProperties
▸ removeAllGlobalEventProperties(): void
Returns
void
Defined in
removeGlobalEventProperty
▸ removeGlobalEventProperty(key
): void
Parameters
Name | Type |
---|---|
key |
string |
Returns
void
Defined in
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
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
setGlobalEventProperties
▸ setGlobalEventProperties(properties
, immutable?
): void
Parameters
Name | Type | Default value |
---|---|---|
properties |
Object |
undefined |
immutable |
boolean |
false |
Returns
void
Defined in
setGlobalEventProperty
▸ setGlobalEventProperty(key
, value
, immutable?
): void
Parameters
Name | Type | Default value |
---|---|---|
key |
string |
undefined |
value |
string |
undefined |
immutable |
boolean |
false |
Returns
void
Defined in
trackCustomEvent
▸ trackCustomEvent(name
, properties?
): void
Tracks custom event.
Parameters
Name | Type |
---|---|
name |
string |
properties |
Object |
Returns
void
Defined in
trackNavigationEvent
▸ trackNavigationEvent(screenName
, viewState
): void
Tracks navigation event.
Parameters
Name | Type |
---|---|
screenName |
string |
viewState |
ViewState |
Returns
void
Defined in
7) Sensitive views Functions
registerBlacklistedView
▸ registerBlacklistedView(ref
): void
Parameters
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns
void
Defined in
registerWhitelistedView
▸ registerWhitelistedView(ref
): void
Parameters
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns
void
Defined in
setViewIsSensitive
▸ setViewIsSensitive(ref
, isSensitive
): void
Parameters
Name | Type |
---|---|
ref |
ComponentOrHandle |
isSensitive |
boolean |
Returns
void
Defined in
unregisterBlacklistedView
▸ unregisterBlacklistedView(ref
): void
Parameters
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns
void
Defined in
unregisterWhitelistedView
▸ unregisterWhitelistedView(ref
): void
Parameters
Name | Type |
---|---|
ref |
ComponentOrHandle |
Returns
void
Defined in
8) Dashboard urls Functions
enableCrashlytics
▸ enableCrashlytics(enabled
): void
Parameters
Name | Type |
---|---|
enabled |
boolean |
Returns
void
Defined in
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
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
registerIntegrationListener
▸ registerIntegrationListener(dashboardSessionUrlCallback
, dashboardVisitorUrlCallback
): void
Parameters
Name | Type |
---|---|
dashboardSessionUrlCallback |
(url : string ) => void |
dashboardVisitorUrlCallback |
(url : string ) => void |
Returns
void
Defined in
unregisterIntegrationListener
▸ unregisterIntegrationListener(): void
Returns
void
Defined in
9) Other Functions
resetSession
▸ resetSession(resetUser
): void
Parameters
Name | Type |
---|---|
resetUser |
boolean |
Returns
void
Defined in
setRenderingMode
▸ setRenderingMode(renderingMode
): void
Parameters
Name | Type |
---|---|
renderingMode |
RenderingMode |
Returns
void