Skip to content

Commit 55dd624

Browse files
authored
v0.1.0 preview.14 (#73)
* chore: license & legal info * chore: use dd tool to generate licenses CSV * chore: override missing fields in LICENSE-3rdparty.csv * v0.1.0-preview.14
1 parent 1eee32f commit 55dd624

16 files changed

Lines changed: 1044 additions & 63 deletions

.github/workflows/ci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ jobs:
3636
- name: Install dependencies
3737
run: yarn install --frozen-lockfile
3838

39-
- name: Check license report
40-
run: yarn license-report:check
41-
4239
- name: Lint
4340
run: yarn lint
4441

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.12

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
77
---
88

9+
## v0.1.0-preview.14
10+
11+
- Internal updates
12+
13+
## v0.1.0-preview.13
14+
15+
- Internal updates
16+
917
## v0.1.0-preview.12
1018

1119
**Internal Changes:**

LICENSE-3rdparty.csv

Lines changed: 878 additions & 6 deletions
Large diffs are not rendered by default.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"npmClient": "yarn",
3-
"version": "0.1.0-preview.13"
3+
"version": "0.1.0-preview.14"
44
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"test:unit": "lerna run test --stream",
1414
"test:unit:watch": "lerna run test --stream --parallel",
1515
"test:browser-install": "scripts/test-package-install.sh",
16-
"license-report:generate": "scripts/license-report-generate.sh",
17-
"license-report:check": "scripts/license-report-check.sh",
16+
"licenses:generate": "scripts/licenses-generate.sh",
1817
"lint": "biome check . --diagnostic-level=error",
1918
"lint:fix": "biome check --write .",
2019
"typecheck": "lerna run typecheck --stream",

packages/browser/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Datadog OpenFeature Browser
2+
3+
## Installation
4+
5+
### For Customers (Recommended)
6+
7+
**We do not recommend pinning to an exact _preview_ version:**
8+
9+
Use the `preview` tag for the latest preview version:
10+
11+
```bash
12+
npm install @datadog/openfeature-browser@preview
13+
```
14+
15+
This will install the latest _preview_ version.
16+
17+
### Specific Version
18+
19+
You can also install a specific _preview_ version:
20+
21+
```bash
22+
npm install @datadog/openfeature-browser@0.1.0-preview.x
23+
```
24+
25+
## Quick Start
26+
27+
The main entry point is `DatadogProvider`, which is a provider for the [OpenFeature Web SDK](https://openfeature.dev/docs/reference/technologies/client/web/).
28+
29+
```javascript
30+
import { DatadogProvider } from '@datadog/openfeature-browser'
31+
import { OpenFeature } from '@openfeature/web-sdk'
32+
33+
// Initialize the provider
34+
const provider = new DatadogProvider({
35+
clientToken: 'your-datadog-client-token',
36+
enableExposureLogging: true,
37+
site: 'datadoghq.com',
38+
})
39+
40+
// Set the provider
41+
await OpenFeature.setProvider(provider)
42+
43+
// Get a client and evaluate flags
44+
const client = OpenFeature.getClient()
45+
const flagValue = await client.getBooleanValue('my-flag', false)
46+
```
47+
48+
## Configuration
49+
50+
```javascript
51+
const provider = new DatadogProvider({
52+
// Required
53+
clientToken: 'pub_...', // Your Datadog client token
54+
site: 'datadoghq.com', // Datadog site (datadoghq.com, datadoghq.eu, etc.)
55+
env: 'production', // Environment
56+
57+
// Optional Datadog configuration
58+
service: 'my-service', // Service name
59+
version: '1.0.0', // Application version
60+
applicationId: 'app-id', // Your application ID for RUM attribution
61+
62+
// Enable exposure logging
63+
enableExposureLogging: true,
64+
})
65+
```
66+
67+
## Usage Examples
68+
69+
### Flag Evaluation
70+
71+
```javascript
72+
const client = OpenFeature.getClient()
73+
74+
// Boolean flags
75+
const showFeature = await client.getBooleanValue('show-new-feature', false)
76+
77+
// String flags
78+
const theme = await client.getStringValue('app-theme', 'light')
79+
80+
// Number flags
81+
const timeout = await client.getNumberValue('request-timeout', 5000)
82+
83+
// Object flags
84+
const config = await client.getObjectValue('feature-config', {})
85+
```
86+
87+
### Using Evaluation Context
88+
89+
Context must be set globally before flag evaluation and affects all subsequent evaluations:
90+
91+
```javascript
92+
// Set global context (async operation)
93+
await OpenFeature.setContext({
94+
targetingKey: 'user-123',
95+
user: { id: 'user-123', email: 'user@example.com' },
96+
})
97+
98+
// Now evaluate flags with the context
99+
const result = await client.getBooleanDetails('premium-feature', false)
100+
console.log(result.value) // Flag value
101+
console.log(result.reason) // Evaluation reason
102+
```
103+
104+
## End-user license agreement
105+
106+
https://www.datadoghq.com/legal/eula

packages/browser/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@datadog/openfeature-browser",
3-
"version": "0.1.0-preview.13",
3+
"version": "0.1.0-preview.14",
44
"description": "Browser-specific bindings for OpenFeature (wraps @datadog/openfeature-core)",
5-
"license": "MIT",
5+
"license": "Apache-2.0",
66
"homepage": "https://github.com/DataDog/openfeature-js-client#readme",
77
"repository": {
88
"type": "git",
@@ -45,7 +45,7 @@
4545
},
4646
"dependencies": {
4747
"@datadog/browser-core": "^6.19.0",
48-
"@datadog/flagging-core": "0.1.0-preview.13",
48+
"@datadog/flagging-core": "0.1.0-preview.14",
4949
"@types/chrome": "^0.1.18"
5050
},
5151
"peerDependencies": {

packages/core/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Datadog OpenFeature Core Library
2+
3+
## End-user license agreement
4+
5+
https://www.datadoghq.com/legal/eula
6+

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@datadog/flagging-core",
3-
"version": "0.1.0-preview.13",
3+
"version": "0.1.0-preview.14",
44
"description": "Runtime-agnostic flag-evaluation logic for Datadog Flagging",
5-
"license": "MIT",
5+
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/DataDog/openfeature-js-client.git",

0 commit comments

Comments
 (0)