@flipt-io/flipt-client-js 0.0.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -9
- package/dist/browser/index.cjs +25 -9
- package/dist/browser/index.mjs +25 -10
- package/dist/flipt_engine_wasm_js_bg.wasm +0 -0
- package/dist/node/index.cjs +25 -9
- package/dist/node/index.mjs +25 -10
- package/dist/slim/index.cjs +24 -8
- package/dist/slim/index.mjs +24 -9
- package/dist/types/browser/index.d.ts +0 -1
- package/dist/types/core/base.d.ts +2 -2
- package/dist/types/core/types.d.ts +17 -1
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ console.log(variant);
|
|
|
44
44
|
The `FliptClient` constructor accepts the following optional arguments:
|
|
45
45
|
|
|
46
46
|
- `options`: An instance of the `ClientOptions` type that supports several options for the client. The structure is:
|
|
47
|
+
- `environment`: The environment to use when evaluating flags (Flipt v2). If not provided, the client will default to the `default` environment.
|
|
47
48
|
- `namespace`: The namespace to fetch flag state from. If not provided, the client will default to the `default` namespace.
|
|
48
49
|
- `url`: The URL of the upstream Flipt instance. If not provided, the client will default to `http://localhost:8080`.
|
|
49
50
|
- `updateInterval`: **Node.js Only** The interval (in seconds) in which to fetch new flag state. If not provided, the client will default to 120 seconds.
|
|
@@ -156,7 +157,7 @@ The `slim` build of the FliptClient is designed for environments where you want
|
|
|
156
157
|
|
|
157
158
|
```ts
|
|
158
159
|
import { FliptClient } from '@flipt-io/flipt-client-js/slim';
|
|
159
|
-
import wasmUrl from '@flipt-io/flipt-client-js/engine.wasm
|
|
160
|
+
import wasmUrl from '@flipt-io/flipt-client-js/engine.wasm';
|
|
160
161
|
|
|
161
162
|
async function main() {
|
|
162
163
|
const client = await FliptClient.init(
|
|
@@ -180,14 +181,6 @@ The `slim` build of the FliptClient is designed for environments where you want
|
|
|
180
181
|
main();
|
|
181
182
|
```
|
|
182
183
|
|
|
183
|
-
- **Note:** If your bundler supports importing JS proxies for assets, you can also use:
|
|
184
|
-
|
|
185
|
-
```js
|
|
186
|
-
import wasmUrl from '@flipt-io/flipt-client-js/engine.wasm';
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Otherwise, use the `?url` syntax for maximum compatibility.
|
|
190
|
-
|
|
191
184
|
2. **Ensure your bundler is configured to handle `.wasm` files.**
|
|
192
185
|
- For Vite, this works out of the box.
|
|
193
186
|
- For Webpack, you may need to add a rule for `.wasm` files.
|