-
Notifications
You must be signed in to change notification settings - Fork 5
Description
For sure, if you are only working on treatments for a single client then you can create the client as follows:
var factory = splitio({
core: {
authorizationKey: 'browser key here',
key: 'user_id' // unique identifier for your user
}
});
var client = factory.client();
But if you want to get treatments for many different users, it is inefficient to construct an entirely new client this way. Instead, you can reuse the factory and supply a new client key with this kind of call:
client = factory.client(key);
Here, the key can be set to an entirely different user id, reusing much of the under-the-hood SDK workings and speeding things up.
If the could be updated with a new key then it could be reused. Creating a for each unique user can be resource intense otherwise.