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
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | int | 1000 ||
34
-
| maxEventStreamRetries | FLAGD_MAX_EVENT_STREAM_RETRIES | int | 5 ||
47
+
This is the default mode of operation of the provider.
48
+
In this mode, FlagdProvider communicates with flagd via the gRPC protocol.
49
+
Flag evaluations take place remotely at the connected [flagd](https://flagd.dev/) instance.
35
50
36
-
### Example Using TCP
51
+
```ts
52
+
OpenFeature.setProvider(newFlagdProvider())
53
+
```
54
+
55
+
In the above example, the provider expects flagd to be available at `localhost:8013` (default host and port).
56
+
57
+
Alternatively, you can use socket paths to connect to flagd.
37
58
38
59
```
39
60
OpenFeature.setProvider(new FlagdProvider({
40
-
host: 'localhost',
41
-
port: 8013,
61
+
socketPath: "/tmp/flagd.socks",
42
62
}))
43
63
```
44
64
45
-
### Example Using a Unix Socket
65
+
### In-process resolver
66
+
67
+
This mode performs flag evaluations locally (in-process).
68
+
Flag configurations for evaluation are obtained via gRPC protocol using [sync protobuf schema](https://buf.build/open-feature/flagd/file/main:sync/v1/sync_service.proto) service definition.
46
69
47
70
```
48
71
OpenFeature.setProvider(new FlagdProvider({
49
-
socketPath: "/tmp/flagd.socks",
72
+
resolverType: 'in-process',
50
73
}))
51
74
```
52
75
76
+
In the above example, the provider expects a flag sync service implementation to be available at `localhost:8013` (default host and port).
77
+
53
78
### Supported Events
54
79
55
80
The flagd provider emits `PROVIDER_READY`, `PROVIDER_ERROR` and `PROVIDER_CONFIGURATION_CHANGED` events.
0 commit comments