You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/plugins.mdx
+29-37Lines changed: 29 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,26 +26,13 @@ If you are developing your app using Next.js, this plugin automatically loads Sa
26
26
These values allow you to instantiate Juno in your code without the need to manually define environment variables.
27
27
28
28
```javascript
29
-
//Init a Satellite
29
+
//Initialize the Satellite using values from juno.config
30
30
awaitinitSatellite();
31
31
32
-
//Init the analytics
32
+
//Initialize analytics using values from juno.config
33
33
initOrbiter();
34
34
```
35
35
36
-
However, if you wish to explicitly use the environment variables that are loaded by the plugin, you can do so. This is notably required if you specify a prefix other than `NEXT_PUBLIC_`.
In other words, if you want to include additional Next.js configuration (e.g. `i18n`, `env` etc.), just define them in your `nextConfig` object and pass it to `withJuno`.
85
78
86
-
### Local development
87
-
88
-
By default, the plugin supports local development and loads environment variables accordingly.
The plugin injects environment variables derived from your `juno.config` file. You can use these variables in your app, which is especially helpful if you’ve specified a custom prefix other than `NEXT_PUBLIC_`.
Discover additional information in the library's [README](https://github.com/junobuild/plugins/tree/main/plugins/nextjs-plugin).
@@ -116,26 +115,13 @@ If you are developing your app using Vite, this plugin automatically loads the S
116
115
These values allow you to instantiate Juno in your code without the need to manually define environment variables.
117
116
118
117
```javascript
119
-
//Init a Satellite
118
+
//Initialize the Satellite using values from juno.config
120
119
awaitinitSatellite();
121
120
122
-
//Init the analytics
121
+
//Initialize analytics using values from juno.config
123
122
initOrbiter();
124
123
```
125
124
126
-
However, if you wish to explicitly use the environment variables that are loaded by the plugin, you can do so. This is notably required if you specify a prefix other than the default, such as `VITE_` or `PUBLIC_`.
The plugin injects environment variables derived from your `juno.config` file. You can use these variables in your app, which is especially helpful if you’ve specified a prefix other than the default, such as `VITE_` or `PUBLIC_`.
169
+
170
+
```javascript
171
+
console.log(process.env.VITE_SATELLITE_ID);
172
+
```
173
+
182
174
### More information
183
175
184
176
Discover additional options in the library's [README](https://github.com/junobuild/plugins/tree/main/plugins/vite-plugin).
0 commit comments