@configdirector/nuxt-sdk 1.4.0 → 1.5.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 CHANGED
@@ -1,6 +1,35 @@
1
1
  # ConfigDirector Nuxt SDK
2
2
 
3
- This is the Nuxt SDK for [ConfigDirector](https://www.configdirector.com).
3
+ [![npm][npm-badge]][npm]
4
+
5
+ Nuxt SDK for [ConfigDirector](https://www.configdirector.com), remote config and feature flags with typed values, JSON Schema validation, and safe renames of live flags. Start free, no card required.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install --save @configdirector/nuxt-sdk
11
+ ```
12
+
13
+ ## Retrieve a value
14
+
15
+ ```ts
16
+ // nuxt.config.ts
17
+ export default defineNuxtConfig({
18
+ modules: ["@configdirector/nuxt-sdk"],
19
+ runtimeConfig: {
20
+ public: { configdirector: { clientSdkKey: "YOUR-CLIENT-SDK-KEY" } },
21
+ configdirector: { serverSdkKey: "YOUR-SERVER-SDK-KEY" },
22
+ },
23
+ });
24
+ ```
25
+
26
+ ```vue
27
+ <script setup lang="ts">
28
+ const { value: darkMode } = useConfigDirectorValue("dark-mode", false);
29
+ </script>
30
+ ```
31
+
32
+ Full details are in the [official documentation](https://docs.configdirector.com/sdks/meta/nuxt).
4
33
 
5
34
  ## Documentation
6
35
 
@@ -10,4 +39,9 @@ There is also [a quickstart guide for ConfigDirector and any of our SDKs](https:
10
39
 
11
40
  ## Getting Help
12
41
 
13
- Reach out to us via https://www.configdirector.com/support
42
+ - [Ask a question in Discussions](https://github.com/orgs/ConfigDirector/discussions)
43
+ - [Contact support](https://www.configdirector.com/support)
44
+
45
+ [//]: # "links"
46
+ [npm-badge]: https://img.shields.io/npm/v/@configdirector/nuxt-sdk.svg
47
+ [npm]: https://www.npmjs.com/package/@configdirector/nuxt-sdk
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "1.4.0"
7
+ "version": "1.5.0"
8
8
  }
@@ -7095,12 +7095,12 @@ var ConfigEvaluator = class {
7095
7095
  return { success: false };
7096
7096
  }
7097
7097
  evaluateConditionalRule(rule, config, context) {
7098
- const condition = (rule.conditions ?? []).find((candidate) => this.conditionEvaluator.evaluate(candidate, context));
7099
- if (condition && rule.target == "value" && rule.value != null) return {
7098
+ const conditionsMet = (rule.conditions ?? []).every((candidate) => this.conditionEvaluator.evaluate(candidate, context));
7099
+ if (conditionsMet && rule.target == "value" && rule.value != null) return {
7100
7100
  success: true,
7101
7101
  value: rule.value.toString()
7102
7102
  };
7103
- else if (condition && rule.target == "percentage") return this.evaluatePercentage(rule.percentages ?? [], config, context);
7103
+ else if (conditionsMet && rule.target == "percentage") return this.evaluatePercentage(rule.percentages ?? [], config, context);
7104
7104
  return { success: false };
7105
7105
  }
7106
7106
  };
@@ -7970,7 +7970,7 @@ var plugin_default = defineNitroPlugin((nitroApp) => {
7970
7970
  const { serverSdkKey, baseUrl, connection } = runtimeConfig.configdirector;
7971
7971
  const client = new DefaultConfigDirectorClient(serverSdkKey, {
7972
7972
  sdkName: "nuxt-sdk",
7973
- sdkVersion: "1.4.0"
7973
+ sdkVersion: "1.5.0"
7974
7974
  }, {
7975
7975
  logger,
7976
7976
  connection: {
@@ -1463,7 +1463,7 @@ var plugin_client_default = defineNuxtPlugin((nuxtApp) => {
1463
1463
  const { clientSdkKey, appName, appVersion, baseUrl } = runtimeConfig.public.configdirector;
1464
1464
  const client = createBrowserClient(clientSdkKey, {
1465
1465
  sdkName: "nuxt-sdk",
1466
- sdkVersion: "1.4.0"
1466
+ sdkVersion: "1.5.0"
1467
1467
  }, {
1468
1468
  metadata: {
1469
1469
  appName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configdirector/nuxt-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Nuxt SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
5
5
  "license": "MIT",
6
6
  "author": "ConfigDirector",