Angular SDK Question
I want to change the Angular sample from https://github.com/splitio/angular-sdk-examples to use my threatments.In my .NET Core application i've configured the API key, which can be found as ID in the Workspace settings. Now in the angular project I've to configure AuthorizationKey and key. What should I configure there exactly and where can I find it?this.splitio = SplitFactory({ core: { authorizationKey: 'XXXXXXX', key: '???'
-
Official comment
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
Please sign in to leave a comment.
Comments
1 comment