Type Function Return value none Revision Release 2025.3721 Keywords analytics, attribution, Tenjin, init See also tenjin.*
tenjin.init() initializes the Tenjin SDK.
Once initialized, you can call any of the other Tenjin API functions such as tenjin.logEvent().
tenjin.init( listener, params )
Listener. Listener that will receive analyticsRequest events.
Table. Table containing Tenjin initialization values — see the next section for details.
The params table includes parameters for the Tenjin initialization.
String. Your Tenjin API Key, gathered from the Tenjin system.
Boolean. If set to false, Tenjin will enable GDPR data collection restrictions, set to true for opposite. Default is false.
Boolean. If set to true, Tenjin SDK registerAppForAdNetworkAttribution will be called.
local tenjin = require( "plugin.tenjin" )
local function tenjinListener( event )
-- Handle events here
end
-- Initialize plugin
tenjin.init( tenjinListener, { apiKey="YOUR_API_KEY" } )