Comments

5 comments

  • Peter Watts

    In a nutshell, I want to create a split, and only show it to a whitelist of users. But I can't figure out how to get these users into the system, in order to add them to the whitelist, or how to identify them on the client so that they get the correct treatment. Trying to do this on the free plan, so API isn't an option.

    0
    Comment actions Permalink
  • Ryan Vila

    Hi Peter,

    If we are talking about using the Javascript SDK, notice there is a 'key' value that is passed when creating the factory. This is your targeting key and your application should pass in this value when the SDK instantiates. 

    If you are using whitelisting and/or segments, the key value here should match what is passed to the SDK at runtime. 

    You may find our Getting Started Guide useful: https://help.split.io/hc/en-us/community/posts/360048097332-JavaScript-Getting-Started-Guide

    To be clear, what you are trying is 100% available to you in our free edition.

    0
    Comment actions Permalink
  • Peter Watts

    Thanks Ryan. I see it now in the docs. Guess I missed the code comments, and thought 'key' was API key.

    One question still. If the user isn't logged in immediately, is it best practise to wait until they do before instantiating the SDK, or is there some way to update the key once they login.

    0
    Comment actions Permalink
  • Ryan Vila

    If the feature is targeted to authenticated users you should wait until the value would be available to your application. If the feature is available to both anonymous and authenticated users it would be better to use some sort of session cookie value to prevent the user experience from changing after they authenticate. Usually this value persists after the user authenticates so even though you now "know" the user, you would continue to use the original UUID/key.

    Here's a blog post we did on managing the user experience across anonymous and authenticated states: https://help.split.io/hc/en-us/articles/360029915971-Consistent-experience-from-anonymous-to-logged-In

    0
    Comment actions Permalink
  • Peter Watts

    Very helpful. Thanks for the prompt replies.

    0
    Comment actions Permalink

Please sign in to leave a comment.