@flexacms/nuxt 0.2.0 → 0.3.1

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
@@ -14,8 +14,8 @@ export default defineNuxtConfig({
14
14
  ```
15
15
 
16
16
  ```env
17
- NUXT_FLEXA_URL=https://cms.example.com
18
17
  NUXT_FLEXA_API_KEY=flx_...
18
+ # NUXT_FLEXA_URL=https://staging.example.com # optional, defaults to https://flexacms.com
19
19
  ```
20
20
 
21
21
  ```vue
@@ -7,9 +7,9 @@ function useFlexaClient() {
7
7
  return client;
8
8
  }
9
9
  const config = useRuntimeConfig().flexa;
10
- if (!config.url || !config.apiKey) {
10
+ if (!config.apiKey) {
11
11
  throw new Error(
12
- "Flexa: set NUXT_FLEXA_URL and NUXT_FLEXA_API_KEY (or flexa.url / flexa.apiKey in nuxt.config)."
12
+ "Flexa: set NUXT_FLEXA_API_KEY (or flexa.apiKey in nuxt.config)."
13
13
  );
14
14
  }
15
15
  client = createClient({
package/dist/module.d.ts CHANGED
@@ -17,7 +17,7 @@ interface FlexaRegister {
17
17
  }
18
18
 
19
19
  interface ModuleOptions {
20
- /** Flexa URL. Prefer the NUXT_FLEXA_URL environment variable. */
20
+ /** Flexa URL. Defaults to https://flexacms.com. Prefer the NUXT_FLEXA_URL environment variable. */
21
21
  url?: string;
22
22
  /** API key, kept server-side. Prefer the NUXT_FLEXA_API_KEY environment variable. */
23
23
  apiKey?: string;
package/dist/module.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  defineNuxtModule
8
8
  } from "@nuxt/kit";
9
9
  import { defu } from "defu";
10
+ import { DEFAULT_URL } from "@flexacms/client";
10
11
  export * from "@flexacms/client";
11
12
  var module_default = defineNuxtModule({
12
13
  meta: {
@@ -24,7 +25,7 @@ var module_default = defineNuxtModule({
24
25
  nuxt.options.runtimeConfig.flexa = defu(
25
26
  nuxt.options.runtimeConfig.flexa,
26
27
  {
27
- url: options.url ?? "",
28
+ url: options.url || DEFAULT_URL,
28
29
  apiKey: options.apiKey ?? "",
29
30
  apiPath: options.apiPath ?? "/api/v1"
30
31
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useFlexaClient
3
- } from "../../chunk-CPEHOITS.js";
3
+ } from "../../chunk-XTVVLL44.js";
4
4
  export {
5
5
  useFlexaClient
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useFlexaClient
3
- } from "../../chunk-CPEHOITS.js";
3
+ } from "../../chunk-XTVVLL44.js";
4
4
  import {
5
5
  proxyRequestPath
6
6
  } from "../../chunk-DKK222XN.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexacms/nuxt",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Nuxt module for the Flexa headless CMS: auto-imported composables and a read-only server proxy that keeps your API key private.",
5
5
  "keywords": [
6
6
  "cms",
@@ -42,7 +42,7 @@
42
42
  "typecheck": "tsc -p tsconfig.json"
43
43
  },
44
44
  "dependencies": {
45
- "@flexacms/client": "^0.2.0",
45
+ "@flexacms/client": "^0.3.1",
46
46
  "@nuxt/kit": "^3.12.0 || ^4.0.0",
47
47
  "defu": "^6.1.4"
48
48
  },