careful-oyster-228
06/23/2023, 9:32 PMfuture-teacher-7046
const gb = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-abc123",
decryptionKey: "key_abc123",
});
For C#, we don't yet have built-in support for decryption in the SDKcareful-oyster-228
06/23/2023, 9:36 PMfuture-teacher-7046
setEncryptedFeatures
method if you don't want to fetch from the front-end.careful-oyster-228
06/23/2023, 9:41 PMbetter-magician-65629
07/04/2023, 6:26 PMasync setEncryptedFeatures(_encryptedString_*:*
_string_, _decryptionKey_*?:*
_string_, _subtle_*?:* SubtleCrypto)*:* Promise<_void_>
is a method on the GrowthBook instance. there's no documentation around it (i've added an issue for us to address this), it seems but it's similar to setFeatures(json)
except you'd pass it the encrypted response string (e.g. the result of encryptedFeatures
in this example) with a decryption key. if on node, you'll need to pass in the polyfill for subtcrypto too (docs) otherwise the browser's webcrypto should be fine.