You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker container used to deploy the Confidence Rust resolver to CloudFlare.
3
+
Docker-based deployer that handles building and publishing the Confidence resolver Worker to your Cloudflare account. The resolver enables feature flag evaluation at Cloudflare's edge locations worldwide, powered by the [Confidence Resolver](https://github.com/spotify/confidence-resolver).
4
+
5
+
## Features
6
+
7
+
***Edge evaluation**: Flag rules evaluate at Cloudflare's edge locations worldwide
8
+
***Ultra-low latency**: Evaluation happens close to users, minimizing latency
9
+
***Rust-based resolver**: High-performance flag evaluation powered by the Confidence Resolver
10
+
***Deployer-driven sync**: Run the deployer to fetch the latest flag rules from Confidence and re-deploy the Worker
4
11
5
12
## Build
6
13
@@ -10,35 +17,62 @@ From the **root of the repository**, run:
You can get the `CONFIDENCE_CLIENT_SECRET` from the Confidence dashboard, under `Clients`.
47
+
The deployer automatically detects:
48
+
49
+
***Cloudflare account ID** from your API token
50
+
***Resolver state** from Confidence CDN
51
+
***Existing deployment** to avoid unnecessary re-deploys
52
+
53
+
> **Note:** The deployer does not poll for changes. Each run fetches the current state from Confidence, deploys the Worker if the state has changed, and then exits. To keep the Worker up to date, run the deployer on a schedule (for example, via a cron job) or trigger it when flag rules or targeting changes are made in Confidence.
29
54
30
55
## Optional Variables
31
56
32
-
| Variable | Description |
33
-
|----------|-------------|
34
-
|`CLOUDFLARE_ACCOUNT_ID`| Required only if the API token has access to multiple accounts |
35
-
|`CONFIDENCE_RESOLVER_STATE_URL`| Custom resolver state URL (overrides default URL to Confidence CDN) |
36
-
|`CONFIDENCE_RESOLVER_ALLOWED_ORIGIN`| Configure allowed origins for CORS |
37
-
|`RESOLVE_TOKEN_ENCRYPTION_KEY`| AES-128 key (base64 encoded) used to encrypt resolve tokens when `apply=false`. Not needed since the resolver defaults `apply` to `true`|
38
-
|`FORCE_DEPLOY`| Force re-deploy regardless of state changes |
|`CLOUDFLARE_ACCOUNT_ID`| Required only if the API token has access to multiple accounts |
60
+
|`CONFIDENCE_RESOLVER_STATE_URL`| Custom resolver state URL (overrides default URL to Confidence CDN) |
61
+
|`CONFIDENCE_RESOLVER_ALLOWED_ORIGIN`| Configure allowed origins for CORS |
62
+
|`RESOLVE_TOKEN_ENCRYPTION_KEY`| AES-128 key (base64 encoded) used to encrypt resolve tokens when `apply=false`. Not needed since the resolver defaults `apply` to `true`|
63
+
|`FORCE_DEPLOY`| Force re-deploy regardless of state changes |
64
+
|`NO_DEPLOY`| Build only, skip deployment |
65
+
66
+
## Service Binding vs HTTP Calls
67
+
68
+
When integrating with the Cloudflare resolver, you have two options:
69
+
70
+
**Service binding (recommended)**: Cloudflare's [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/) allow Workers to call other Workers directly within Cloudflare's network. This internal routing bypasses the public internet, resulting in ultra-low latency.
71
+
72
+
**HTTP calls**: Standard HTTP requests to the resolver endpoint. Use this approach when calling from external services or client applications.
73
+
74
+
For more details on integration, including code examples using the [`@spotify-confidence/sdk`](https://github.com/spotify/confidence-sdk-js), see the [Confidence documentation](https://confidence.spotify.com/docs/sdks/edge/cloudflare#cloudflare-workers).
40
75
41
-
## Sticky Assignments
76
+
## Limitations
42
77
43
-
Sticky assignments are not currently supported with the CloudFlare resolver.
44
-
Flags with sticky assignment rules will return "flag not found".
78
+
***Sticky assignments**: Not currently supported with the Cloudflare resolver. Flags with sticky assignment rules will return "flag not found".
0 commit comments