Skip to main content

Primary and Secondary SDK Key Rotation Feature Intro

· 3 min read
David Herbert
Changing the world, one line of code at a time

There's nothing more frustrating than writing up a thoughtful, intentional feature request to your favorite service provider and then not getting a response or subsequent feedback.

At ConfigCat, we understand the importance of feature requests because we know that our service becomes more successful when our customers are happy and their needs are met.

As a result, we keep track of each of our customers' feature requests to help us make informed product decisions and implement the features that matter most.

The SDK Key Rotation Feature

SDK Key Rotation Feature Thumbnail

The SDK key rotation feature is a newly implemented feature based on a user request that we delivered on the same day. This feature allows you to not only have one primary SDK key in your feature flag’s configuration dashboard but also generate a secondary SDK key while keeping the primary key active.

This makes it possible to rotate between the primary and secondary SDK keys as the need arises without breaking access to your application.

Use case: There are several cases for why you may need a primary and secondary SDK key rotation feature:

  • In case your current SDK key gets compromised, you can create a new one using this feature before deleting the compromised key.
  • Short term: You can have 2 SDK Keys in parallel while removing one from the code so your application doesn’t break.
  • Long term: Having 2 SDK Keys is beneficial to separate the Backend and Frontend of your application.

Note: When deleting an old or compromised key, ensure that you have deployed all your apps with the newly generated SDK Key before deleting the old to not break your app’s access.

How to Use the SDK Key Rotation Feature

To use this feature, head over to your ConfigCat dashboard and click on the “View SDK Key” option.

View SDK Key

Below the SDK key, you’ll find a button that allows you to add a secondary key to your current SDK key.

Add Secondary SDK Key

It is worth noting that when you only have a primary key available, you can not delete this primary key as it is the only valid key for accessing your feature flag configuration.

However, once you generate a secondary SDK key, you can access your feature flags and settings using any of these keys. Additionally, you will then be provided with the option to delete either of your SDK keys if you so wish to.

Primary and Secondary SDK Keys

That’s pretty much how you use the newly implemented SDK key rotation feature. We hope you and your organization find this feature handy.

Don’t forget to follow ConfigCat on Facebook, Twitter and LinkedIn.