I'm seeing different versions of the GrowthBook documentation for Kotlin (back end, not Android), and I'm struggling to get my project off the ground. When I click on the SDK I set up, I see this sample:
GBContext context = GBContext.builder()
.featuresJson(featuresJson)
.attributesJson(userAttributesObj.toString()) // Optional
.encryptionKey("****") // You may want to store this in an environment variable
.trackingCallback(trackingCallback)
.build();
GrowthBook growthBook = new GrowthBook(context);
But when I check
https://github.com/growthbook/growthbook-kotlin , I see this:
var sdkInstance: GrowthBookSDK = GBSDKBuilderJAVA(apiKey = <API_KEY>,
hostURL = <GrowthBook_URL>,
attributes = <Hashmap>,
features = <Hashmap>,
trackingCallback = { gbExperiment, gbExperimentResult ->
}).initialize()
The sample from
<http://app.growthbook.io|app.growthbook.io>
uses
GBContext
and has no API key, while the github sample uses
GBSDKBuilderJAVA
and requires an API key. Which is correct?