File tree Expand file tree Collapse file tree 4 files changed +112
-0
lines changed Expand file tree Collapse file tree 4 files changed +112
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,34 @@ You can add markers to the static and interactive map by providing an array of `
178
178
179
179
See the [ markers] ( https://github.com/nuxt/scripts/blob/main/playground/pages/third-parties/google-maps/markers.vue ) example for more information.
180
180
181
+ #### With Environment Variables
182
+
183
+ If you prefer to configure your API key using environment variables.
184
+
185
+ ``` ts [nuxt.config.ts]
186
+ export default defineNuxtConfig ({
187
+ scripts: {
188
+ registry: {
189
+ googleMaps: true ,
190
+ }
191
+ },
192
+ // you need to provide a runtime config to access the environment variables
193
+ runtimeConfig: {
194
+ public: {
195
+ scripts: {
196
+ googleMaps: {
197
+ apiKey: ' ' , // NUXT_PUBLIC_SCRIPTS_GOOGLE_MAPS_API_KEY
198
+ },
199
+ },
200
+ },
201
+ },
202
+ })
203
+ ```
204
+
205
+ ``` text [.env]
206
+ NUXT_PUBLIC_SCRIPTS_GOOGLE_MAPS_API_KEY=<YOUR_API_KEY>
207
+ ```
208
+
181
209
### Guides
182
210
183
211
#### Eager Loading Placeholder
Original file line number Diff line number Diff line change @@ -78,3 +78,31 @@ pnpm add -D @paypal/paypal-js
78
78
```
79
79
80
80
::
81
+
82
+ #### With Environment Variables
83
+
84
+ If you prefer to configure your client ID using environment variables.
85
+
86
+ ``` ts [nuxt.config.ts]
87
+ export default defineNuxtConfig ({
88
+ scripts: {
89
+ registry: {
90
+ paypal: true ,
91
+ }
92
+ },
93
+ // you need to provide a runtime config to access the environment variables
94
+ runtimeConfig: {
95
+ public: {
96
+ scripts: {
97
+ paypal: {
98
+ clientId: ' ' , // NUXT_PUBLIC_SCRIPTS_PAYPAL_CLIENT_ID
99
+ },
100
+ },
101
+ },
102
+ },
103
+ })
104
+ ```
105
+
106
+ ``` text [.env]
107
+ NUXT_PUBLIC_SCRIPTS_PAYPAL_CLIENT_ID=<YOUR_CLIENT_ID>
108
+ ```
Original file line number Diff line number Diff line change @@ -104,6 +104,34 @@ See the [Facade Component API](/docs/guides/facade-components#facade-components-
104
104
105
105
See the [ Config Schema] ( #config-schema ) for full details.
106
106
107
+ #### With Environment Variables
108
+
109
+ If you prefer to configure your id using environment variables.
110
+
111
+ ``` ts [nuxt.config.ts]
112
+ export default defineNuxtConfig ({
113
+ scripts: {
114
+ registry: {
115
+ crisp: true ,
116
+ }
117
+ },
118
+ // you need to provide a runtime config to access the environment variables
119
+ runtimeConfig: {
120
+ public: {
121
+ scripts: {
122
+ crisp: {
123
+ id: ' ' , // NUXT_PUBLIC_SCRIPTS_CRISP_ID
124
+ },
125
+ },
126
+ },
127
+ },
128
+ })
129
+ ```
130
+
131
+ ``` text [.env]
132
+ NUXT_PUBLIC_SCRIPTS_CRISP_ID=<YOUR_ID>
133
+ ```
134
+
107
135
### Events
108
136
109
137
The ` ScriptCrisp ` component emits a single ` ready ` event when crisp is loaded.
Original file line number Diff line number Diff line change @@ -87,6 +87,34 @@ See the [Facade Component API](/docs/guides/facade-components#facade-components-
87
87
88
88
See the [ Config Schema] ( #config-schema ) for full details.
89
89
90
+ #### With Environment Variables
91
+
92
+ If you prefer to configure your app ID using environment variables.
93
+
94
+ ``` ts [nuxt.config.ts]
95
+ export default defineNuxtConfig ({
96
+ scripts: {
97
+ registry: {
98
+ intercom: true ,
99
+ }
100
+ },
101
+ // you need to provide a runtime config to access the environment variables
102
+ runtimeConfig: {
103
+ public: {
104
+ scripts: {
105
+ intercom: {
106
+ app_id: ' ' , // NUXT_PUBLIC_SCRIPTS_INTERCOM_APP_ID
107
+ },
108
+ },
109
+ },
110
+ },
111
+ })
112
+ ```
113
+
114
+ ``` text [.env]
115
+ NUXT_PUBLIC_SCRIPTS_INTERCOM_APP_ID=<YOUR_APP_ID>
116
+ ```
117
+
90
118
### Events
91
119
92
120
The ` ScriptIntercom ` component emits a single ` ready ` event when Intercom is loaded.
You can’t perform that action at this time.
0 commit comments