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

# OpenFeature Web Provider

> OpenFeature Web SDK provider for Westyx Nexus - connect feature flags and configs to the OpenFeature standard.

OpenFeature Web SDK provider for [Westyx Nexus](https://westyx.dev) - connects Nexus feature flags and configs to the [OpenFeature](https://openfeature.dev) standard browser SDK.

```ts theme={null}
import { OpenFeature } from '@openfeature/web-sdk';
import { NexusProvider } from '@westyx-nexus/openfeature-web-provider';

await OpenFeature.setProviderAndWait(
  new NexusProvider({
    endpoint: 'https://api.westyx.dev',
    apiKey: 'wxp_...',
  })
);

const client = OpenFeature.getClient();
const showBanner = client.getBooleanValue('banner.enabled', false);
```

## What's new in v0.8.0

* **Initial release** - OpenFeature Web SDK provider for Westyx Nexus.
* Implements `Provider` interface from `@openfeature/web-sdk` ^1.3.
* Boolean flags via `resolveBooleanEvaluation` (maps to Nexus feature flags).
* String, number, and object resolution via Nexus configs (JSON-typed values).
* Automatic SSE connection with exponential backoff reconnect.
* Emits `PROVIDER_CONFIGURATION_CHANGED` on flag or config update via SSE.

## Highlights

* **Framework-agnostic** - works with any browser TypeScript/JavaScript app, Angular, React, Vue, Svelte, etc.
* **OpenFeature standard** - use the vendor-neutral `OpenFeature.getClient()` API; swap providers without rewriting flag evaluation code.
* **Live updates via SSE** - the provider maintains a server-sent events connection and emits `PROVIDER_CONFIGURATION_CHANGED` within milliseconds of any flag or config change.
* **Exponential backoff** - SSE reconnects automatically with capped backoff (1 s to 30 s) on transient failures.
* **Public key only** - uses `wxp_...` browser keys. Secret keys are rejected.

<Warning>
  Browser SDKs must use a `wxp_...` (public) key. Never embed secret keys (`wxs_...`) in browser code.
</Warning>

## Package

Install via npm:

```bash theme={null}
npm install @westyx-nexus/openfeature-web-provider @openfeature/web-sdk
```

Latest release: **v0.8.0**.

## Pages

| Page                         | Description                                                      |
| ---------------------------- | ---------------------------------------------------------------- |
| [Installation](installation) | Install and configure the package                                |
| [Usage](usage)               | Full usage guide with all resolve types and live update handling |
