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/realm/customization/import-npm-library.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,57 @@ If you are working in Reunite, you can install the library by adding it to the `
31
31
Follow the steps in [Run a specific version in Reunite](../get-started/upgrade-realm-version.md#run-a-specific-version-in-reunite)
32
32
to create a `package.json` file if you don't have one already.
33
33
34
+
## Configure private registries
35
+
36
+
If you need to install libraries from private NPM registries (such as Artifactory, AWS CodeArtifact, or GitHub Packages), you can configure registry access using either `.npmrc` or `bunfig.toml` files.
37
+
38
+
### Use `.npmrc`
39
+
40
+
Create a `.npmrc` file in your project root:
41
+
42
+
```text
43
+
@myorg:registry=https://registry.myorg.com/
44
+
//registry.myorg.com/:_authToken=${NPM_TOKEN}
45
+
```
46
+
47
+
### Use `bunfig.toml` (recommended)
48
+
49
+
For enhanced flexibility, create a `bunfig.toml` file in your project root:
Never commit registry credentials directly to your repository.
68
+
Always use environment variables for sensitive information like tokens, usernames, and passwords.
69
+
{% /admonition %}
70
+
71
+
Store your registry credentials as environment variables:
72
+
73
+
- For local development, add them to your `.env` file (do not commit secrets to Git):
74
+
```text
75
+
NPM_TOKEN=your-private-token-here
76
+
NPM_USERNAME=your-username
77
+
NPM_PASSWORD=your-password
78
+
```
79
+
80
+
- For Reunite projects, add them through the **Settings** > **Environment variables** page and mark them as secrets.
81
+
Reunite supports environment variable names that start with `NPM_` for private package registries.
82
+
83
+
For more information about managing environment variables, see **[Environment variables](../reunite/project/env-variables.md)**.
84
+
34
85
## Import and use components
35
86
36
87
After installation, you can import components directly in your React files, as in the following example:
@@ -110,5 +161,6 @@ You can use the icon component in your Markdoc files, as in the following exampl
110
161
111
162
## Resources
112
163
164
+
-**[Environment variables](../reunite/project/env-variables.md)** - Configure secure credentials for private registry access using environment variables
113
165
-**[Build custom Markdoc tags](./build-markdoc-tags.md)** - Create reusable Markdoc components using imported NPM libraries for enhanced functionality
114
166
-**[Built-in icon components](../content/markdoc-tags/icon.md)** - Use Redocly's built-in icon system and learn patterns for extending it with external icon libraries
0 commit comments