Angular SDK Question

Comments

1 comment

  • Official comment
    Kevin Li

    Hi Pascal,

    In general, when using our JS SDK, you can find good guidance at the documentation page here: https://docs.split.io/docs/javascript-sdk-overview 

    To answer your question directly though, the way our front end SDKs are setup is pretty different from our BE SDKs. At a high level, to make them more performant and also expose less data about your Split instance on the UI, we purposefully only download information that is relevant to a single user to our JS SDK as they generally only need to serve treatments for a single user. On the other hand, the BE SDKs download everything to be able to serve treatments for all your users across your backend.

    To specify which user you want our SDK to download information for, we have you specify a user_id in that "key" variable you're confused about above. So, you should provide a user id to that field!

    Separately, you should use a different API Key (doc here: https://docs.split.io/docs/understanding-api-keys) when you're instantiating the JS SDK. Make sure to grab a key that is specified as a "browser" type as that key will have fewer permissions than the one you're using for .NET.

    I hope that helps and makes sense!

     

    Comment actions Permalink

Please sign in to leave a comment.