Skip to content

Allow for creating new clients by key #5

@dbmartin00

Description

@dbmartin00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions