@tthr/vue 0.0.6 → 0.0.7
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/nuxt/module.ts +10 -5
- package/package.json +1 -1
package/nuxt/module.ts
CHANGED
|
@@ -43,17 +43,22 @@ export default defineNuxtModule<TetherModuleOptions>({
|
|
|
43
43
|
setup(options, nuxt) {
|
|
44
44
|
const resolver = createResolver(import.meta.url);
|
|
45
45
|
|
|
46
|
+
// Read env vars at build time
|
|
47
|
+
const apiKey = process.env.TETHER_API_KEY || '';
|
|
48
|
+
const url = options.url || process.env.TETHER_URL || 'https://api.tether.strands.gg';
|
|
49
|
+
const projectId = options.projectId || process.env.TETHER_PROJECT_ID || '';
|
|
50
|
+
|
|
46
51
|
// Server-side config (includes API key - never exposed to client)
|
|
47
52
|
nuxt.options.runtimeConfig.tether = {
|
|
48
|
-
apiKey
|
|
49
|
-
url
|
|
50
|
-
projectId
|
|
53
|
+
apiKey,
|
|
54
|
+
url,
|
|
55
|
+
projectId,
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
// Public config (safe for client - no secrets)
|
|
54
59
|
nuxt.options.runtimeConfig.public.tether = {
|
|
55
|
-
projectId
|
|
56
|
-
wsUrl:
|
|
60
|
+
projectId,
|
|
61
|
+
wsUrl: url.replace('http', 'ws'),
|
|
57
62
|
};
|
|
58
63
|
|
|
59
64
|
// Add server API routes for proxying Tether requests
|