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
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ import { Bash } from "../components/bash.mdx";
49
49
50
50
In your Next.js config file — whether it's `next.config.js`, `next.config.ts`, `next.config.mjs` or else — wrap your configuration with `withJuno` to automatically load Juno settings:
Copy file name to clipboardExpand all lines: docs/setup-the-sdk.mdx
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,25 +53,43 @@ It is generally recommended to initialize globally the library at the top of you
53
53
54
54
## Configuration
55
55
56
-
To connect your application with a container (your Satellite) and other necessary resources, some configuration is required. This setup ensures your application can securely access and initialize the correct Satellite instance, environment variables, and key settings.
56
+
Juno uses a configuration file to determine which Satellite to connect to. Scaffold a minimal config file using:
57
57
58
-
For most developers, the [Next.js](reference/plugins.mdx#nextjs-plugin) or [Vite](reference/plugins.mdx#vite-plugin) plugins streamline this process by managing environment variables automatically. However, if you're not using one of these plugins, a bit of manual configuration is needed.
58
+
```bash
59
+
npx @junobuild/cli init --minimal
60
+
```
59
61
60
-
### Automated
62
+
This creates a `juno.config` file — in TypeScript, JavaScript, or JSON depending on your preferences — at the root of your project.
61
63
62
-
When using the plugins, the configuration handled through a `juno.config` file (TypeScript, JavaScript, or JSON) at your project root is automatically injected within your application. The plugins read the file and automatically load the required information when you build and run your dApp.
64
+
From there, if you're using **Next.js** or **Vite**, install the official plugin. It reads your config file and injects environment variables automatically for the SDK — no need to pass anything manually.
63
65
64
-
Juno's provided templates come preconfigured with these plugins, so you can quickly get started. For details on setting up the plugin yourself, refer to the [Next.js](reference/plugins.mdx#nextjs-plugin) or [Vite](reference/plugins.mdx#vite-plugin) documentation.
If you aren't using a plugin, you can still configure your application by providing the `satelliteId` directly. In this case, add or update the following in your configuration file:
79
+
exportdefaultdefineConfig({
80
+
plugins: [juno()]
81
+
});
82
+
```
83
+
84
+
:::note
85
+
86
+
The templates already include both the config file and the plugin setup.
87
+
88
+
:::
89
+
90
+
#### Not using a plugin?
91
+
92
+
You can also pass the Satellite ID manually to the SDK, though using the plugins is the preferred approach:
75
93
76
94
```typescript
77
95
import { initSatellite } from"@junobuild/core";
@@ -81,6 +99,4 @@ await initSatellite({
81
99
});
82
100
```
83
101
84
-
Replace `your-actual-satellite-id` with your actual ID, available in the [console](https://console.juno.build) on the overview page.
0 commit comments