flowrix 1.0.1-beta.23 → 1.0.1-beta.25

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowrix",
3
3
  "configKey": "flowrix",
4
- "version": "1.0.1-beta.23",
4
+ "version": "1.0.1-beta.25",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,11 +1,12 @@
1
1
  const isServer = typeof process !== "undefined" && process.server;
2
2
  function getEnv(key) {
3
- if (typeof useRuntimeConfig === "function") {
4
- const config = useRuntimeConfig();
5
- console.log(config);
6
- return config.public?.[key] || config[key];
3
+ try {
4
+ const nuxtConfig = globalThis?.useRuntimeConfig && globalThis.useRuntimeConfig() || typeof useRuntimeConfig === "function" && useRuntimeConfig();
5
+ if (nuxtConfig)
6
+ return nuxtConfig.public?.[key] || nuxtConfig[key];
7
+ } catch {
7
8
  }
8
- return process.env[key];
9
+ return process?.env?.[key];
9
10
  }
10
11
  async function request(method, endpoint, options = {}, apiversion) {
11
12
  console.log("checkt useRuntimeConfig", typeof useRuntimeConfig === "function");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowrix",
3
- "version": "1.0.1-beta.23",
3
+ "version": "1.0.1-beta.25",
4
4
  "description": "lug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- import { setFlowrixConfig } from "flowrix/api/flowrix";
2
- export default defineNuxtPlugin(() => {
3
- const config = useRuntimeConfig();
4
- setFlowrixConfig(config);
5
- });