Cloudflare KV is a key-value storage system that seamlessly integrates with Cloudflare's edge computing platform, enabling fast and scalable data storage and retrieval.
Statsig's integration with Cloudflare KV allows you to effortlessly push your Statsig configurations to Cloudflare's key-value storage. This integration enables you to quickly bootstrap your Cloudflare projects by syncing your Statsig configurations with Cloudflare KV.
By leveraging Cloudflare KV, you can ensure that your application's settings and feature flags are readily available at the edge, closer to your users. This integration streamlines the process of managing and deploying your application configurations, making it easier to roll out new features and experiments.
Configuring the Cloudflare KV integration in Statsig is straightforward. Navigate to the Cloudflare integration in Statsig's Console under Project Settings -> Integrations. Here, you'll need to provide the necessary credentials: Cloudflare Account ID, KV Namespace ID, and Cloudflare API Key.
The Cloudflare Account ID can be found in the Cloudflare portal under Account Home -> Workers, on the right-hand side. The KV Namespace ID is located in the Cloudflare portal under Account Home -> Workers -> KV, and can be easily copied from the table view. Lastly, the Cloudflare API Token is available in the Cloudflare portal under Account Home -> Profile -> API Tokens; ensure the token has Account.Workers KV Storage Edit Permissions.
After providing the required credentials and setting up the integration, the final step is to implement the Statsig Cloudflare KV Data Adapter into your worker. This adapter allows your Cloudflare worker to seamlessly access and utilize the Statsig Configs pushed to your Cloudflare KV, enabling you to quickly bootstrap your Cloudflare projects with Statsig's powerful experimentation and feature management capabilities.
When using Statsig's Cloudflare KV integration, there are a few limitations and best practices to keep in mind:
Cloudflare KV size limits may prevent Statsig from pushing larger configs. Check the latest Cloudflare KV limits to ensure your configs fit within the constraints.
Statsig ID Lists are not currently synced to Cloudflare KVs. If you rely heavily on ID Lists, consider alternative solutions or reach out to Statsig support for guidance.
When moving from a proof of concept to a production environment with Cloudflare KV:
Review your project structure and naming conventions. Ensure they align with your production needs and make any necessary adjustments before transitioning.
Set up SSO for seamless onboarding and user management. This simplifies access control and ensures users have the appropriate permissions.
Establish change management policies for your production environment. Statsig allows you to require reviews and apply granular permissions to maintain control and stability.
Configure key metrics and dimensions to enable effective experimentation and analysis. Consider custom metrics, user dimensions, metric dimensions, and funnels to gain valuable insights.
Determine the appropriate IDs for experimentation, such as userID, stableID, or arbitrary units of assignment like organizationID or creatorID, depending on your use case.
Leverage integrations to enhance your workflow, such as exporting assignment data to your data warehouse or sending change history notifications to communication channels.
Foster a culture of experimentation by establishing best practices, forums for knowledge sharing, and training sessions to empower your teams.
By addressing these considerations and following best practices, you can successfully transition from a proof of concept to a production-ready implementation of Statsig's Cloudflare KV integration.