The init()
method initializes Smartlook recorder.
Syntax
init(key)
init(key, options)
init(key, options, doneCallback)
Parameters
key
- Project key.
options
-
Optional object where you can specify
region
andversion
.region
-eu
orus
version
-nextgen
orlegacy
doneCallback
- Optional callback to determine when Smartlook is initialized.
Return value
void
Description
Smartlook.init()
lets you initialize Smartlook. There is one obligatory parameter key
, which you can find in the project settings.
Examples
Simple initialization.
Smartlook.init('YOUR_PROJECT_KEY')
Initialization with region selection.
Smartlook.init('YOUR_PROJECT_KEY', { region: 'eu' })
Initialization with version selection.
Smartlook.init('YOUR_PROJECT_KEY', { version: 'nextgen' })
Initialization with region and version selection.
Smartlook.init('YOUR_PROJECT_KEY', {
region: 'eu',
version: 'nextgen',
})
Initialization with doneCallback
.
Smartlook.init(
'YOUR_PROJECT_KEY',
undefined,
() => console.log('Smartlook is now initialized'),
)