---
title: "Any OpenFeature provider (OFREP)"
description: "Evaluate flags with OpenFeature's OFREP providers in any language, or call the protocol directly."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Any OpenFeature provider (OFREP)

`https://flags.ezghcloud.com` speaks the [OpenFeature Remote Evaluation Protocol](https://openfeature.dev/specification/appendix-c)
(OFREP), so OpenFeature's own OFREP providers work with Feature Flags in every language
OpenFeature supports, including mobile, Java and .NET. Configure them with:

- **Base URL:** `https://flags.ezghcloud.com`
- **Header:** `Authorization: Bearer <SDK key>`: a server key on servers, a client key in browsers
  and apps ([SDK keys](/flags/environments-and-keys)).

OFREP providers evaluate on EZGH's servers, one request per evaluation or, for the web and mobile
providers, one request for every flag. EZGH's own [server providers](/flags/quickstart-node)
evaluate locally instead.

## JavaScript

```ts
// Servers: npm install @openfeature/server-sdk @openfeature/ofrep-provider
import { OpenFeature } from "@openfeature/server-sdk"
import { OFREPProvider } from "@openfeature/ofrep-provider"

OpenFeature.setProvider(new OFREPProvider({
  baseUrl: "https://flags.ezghcloud.com",
  headers: [["Authorization", `Bearer ${process.env.EZGH_FLAGS_SDK_KEY}`]],
}))
```

```ts
// Browsers: npm install @openfeature/web-sdk @openfeature/ofrep-web-provider
import { OpenFeature } from "@openfeature/web-sdk"
import { OFREPWebProvider } from "@openfeature/ofrep-web-provider"

OpenFeature.setProvider(new OFREPWebProvider({
  baseUrl: "https://flags.ezghcloud.com",
  headers: [["Authorization", "Bearer ezgh_fc_…"]],
}))
```

## Go

```go
import "github.com/open-feature/go-sdk-contrib/providers/ofrep"

provider := ofrep.NewProvider("https://flags.ezghcloud.com", ofrep.WithBearerToken(os.Getenv("EZGH_FLAGS_SDK_KEY")))
```

## Python

```python
from openfeature.contrib.provider.ofrep import OFREPProvider

provider = OFREPProvider(
    "https://flags.ezghcloud.com",
    headers_factory=lambda: {"Authorization": f"Bearer {os.environ['EZGH_FLAGS_SDK_KEY']}"},
)
```

## The protocol

| Request | Answers |
| --- | --- |
| `POST /ofrep/v1/evaluate/flags/{key}` | One flag: `{ key, value, variant, reason, metadata }` |
| `POST /ofrep/v1/evaluate/flags` | Every flag the key sees, with an `ETag`; sending it back as `If-None-Match` answers `304` while nothing changed |

The body is the evaluation context, at most 8 KB: `{ "context": { "targetingKey": "user-1842",
"plan": "pro" } }`.

```sh
curl -X POST https://flags.ezghcloud.com/ofrep/v1/evaluate/flags/new-checkout \
  -H "Authorization: Bearer $EZGH_FLAGS_SDK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context": {"targetingKey": "user-1842", "plan": "pro"}}'
```

```json
{ "key": "new-checkout", "value": true, "variant": "true", "reason": "TARGETING_MATCH", "metadata": { "flagVersion": 12 } }
```

- `reason` is `DISABLED` (the flag is off: the value is its off variation), `TARGETING_MATCH`,
  `DEFAULT` or `STATIC` ([Targeting](/flags/targeting#the-order)). `metadata.flagVersion` is the
  version of the flag's targeting in that environment.
- **A flag that doesn't exist, is archived, or isn't client-side when the key is a client key**
  answers `404` with `errorCode` `FLAG_NOT_FOUND`. A context that isn't valid answers `400` with
  `INVALID_CONTEXT`.
- **A missing, unknown or revoked key** answers `401`. **Over a [rate limit](/flags/limits)** answers
  `429` with `Retry-After`.
- Browsers may call it from any site: it allows every origin, and sends no cookies.

Source: https://docs.ezghcloud.com/flags/ofrep/index.mdx
