Initialization Options
The SDK supports a TapInitOptions
object for additional configuration. The structure is shown below (Kotlin example):
data class TapInitOptions(
val userAttributes: HashMap<String, Any>? = null,
val clearPreviousAttributes: Boolean? = false,
)
Configuration Options
Key | Description | Required? |
---|---|---|
userAttributes | User attributes hash, see usages here | No |
clearPreviousAttributes | Will clear our any attributes stored on tapresearch backend for the current user | No |
User Attributes in TapInitOptions
Best practice: If user attributes are known at SDK initialization, pass them through initOptions
instead of using sendUserAttributes
.
Benefit: Faster load times for targeted content.
Clearing Previous Attributes
User attributes sent from the SDK (via TapInitOptions
or sendUserAttributes
) are stored on the TapResearch backend for targeting purposes.
Use clearPreviousAttributes
to remove all previously stored attribute values for a user. This is useful when:
- A user logs out
- User data needs to be reset
- Starting fresh with new attributes