Scoped registries allow Unity to communicate the location of any custom package registry server to the Package Manager so you can access several collections of packages at the same time.
Here are some important concepts to help you understand this feature:
Concept | Description |
---|---|
package registry server | An application that keeps track of packages and provides a place to store them. In Unity’s Package Manager window, all packages registered on Unity’s registry appear in the list panel when you select the Unity Registry context. |
package manager | An application that tells the user what packages are available, and downloads and installs whatever package the user requests for their project. Unity has implemented its own version of a package manager, but there are several similar applications in other organizations. |
scope | Defines a package name or namespace (in reverse domain format), such as com.example.mycompany.animation or com.example . When a user requests a package, the Package Manager fetches the package from the registry that best matches the scope. For more information, refer to Managing scoped registries for a project. |
The way you interact with scoped registries depends on your role:
As a package provider, make sure any package registry servers you set up conform to Unity’s Terms of Service and Unity’s Package Guiding Principles & Guidelines. Unity provides access to the Package Manager to facilitate sharing knowledge and creations, but not as a marketplace for third-party products.
As a package consumer, when you install a scoped registry, use the same level of caution that you use when installing any other third-party software:
Scoped registries can help to:
Provide new functionality by distributing tools, libraries, and other assets.
As a provider, you can create your own registry to distribute tools and scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary (or other types of assets) with version numbers that indicate how mature the package is. Version numbers also indicate whether updates introduce breaking API changes or minor fixes, based on Semantic Versioning. Your code can depend on code in other packages, because the Package Manager supports package dependencies.
As a consumer, your experience of browsing and installing third-party custom packages in the Package Manager is the same as browsing Unity’s packages.
Extend existing Unity’s package features.
As a consumer, you can have a seamless experience where the custom package overrides the Unity package without having to manually change registries or explicitly install a different package version. This is because you can map packages to a specific registry so that Package Manager fetches from either the Unity registry or a custom package registry server.
Access packages in a closed network environment.
Some organizations work inside a closed network, which makes it difficult to access Unity’s package registry. In these cases, the organization can set up their own package registry on a server inside their closed network. The network administrators can then periodically synchronize with Unity’s package registry to make sure the scoped registry has the latest set of packages available.
If you’re a package consumer, refer to Managing scoped registries for a project for information about connecting to an existing custom package registry server in your Unity project. If you’re a package producer, refer to Sharing your package for information about supported package registry servers. This information also includes links to information on how to set them up to use with scoped registries.
Note: If you’re setting up a scoped registry that points to a package registry server with restricted access, you can configure Package Manager to pass your npm
authentication token to the server. For more information, refer to Scoped registry authentication.
Use the Package Manager category of the Project SettingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary window to add, modify, or remove scoped registries for your project.
If you’re working in a shared project, and another user adds a scoped registry to the project, Unity warns you that another user added a new scoped registry.
When you click Close, the Package Manager project settings window appears so you can add, modify, or remove scoped registries for your project.
If you click Read more, Unity opens the page you’re currently reading in your default web browser.
Tip: To access the Package Manager project settings window at any time, use the main menu in Unity (Edit > Project Settings, then the Package Manager category). You can also select Advanced Project Settings from the advanced settings menu in the Package Manager window.
To manage the scoped package registries in your project, you can either:
<project>/Packages
directory. The Package Manager uses it to configure many things, including a list of dependencies for that project, as well as any package repository to query for packages. More infoThe project manifest uses a scopedRegistries property, which contains an array of scoped registry configuration objects. Each object has the following properties:
Property | JSON Type | Description |
---|---|---|
name | String | The scope name as it appears in the user interface. The Package Manager window displays this name in the details panel. For example, "name": "Tools" . |
url | String | The URL to the npm-compatible registry server. For example, "url": "https://mycompany.example.com/tools-registry" Note: Not all registry providers are compatible with Unity’s Package Manager. Make sure the package registry server you’re trying to add implements the /-/v1/search or /-/all endpoints. |
overrideBuiltIns | Boolean | A true or false value that determines which version of a built-in package to use, if the package exists in a scoped registry. If set to false , the Package Manager uses the built-in version included with the Unity Editor. This is the default value.If set to true , and the built-in package also exists in a scoped registry, the Package Manager downloads the version in the scoped registry.The scope of this property applies to all packages identified in the url property. |
scopes | Array of Strings | Array of scopes that you can map to a package name, either as an exact match on the package name, or as a namespace. Wildcards and other glob patterns aren’t supported. For example, "scopes": [ "com.example", "com.example.tools.physics" ] Note: This configuration type assumes that packages follow the Reverse domain name notation. This ensures that com.unity is equivalent to any package name that matches the com.unity namespace, such as com.unity.timeline or com.unity.2d.animation .Warning: Unity doesn’t support npm’s scope notation. |
In the project manifest below, there are two scoped registries, General
and Tools
:
{ "scopedRegistries": [ { "name": "General", "url": "https://example.com/registry", "overrideBuiltIns": false, "scopes": [ "com.example", "com.example.tools.physics" ] }, { "name": "Tools", "url": "https://mycompany.example.com/tools-registry", "overrideBuiltIns": true, "scopes": [ "com.example.mycompany.tools" ] } ], "dependencies": { "com.unity.animation": "1.0.0", "com.example.mycompany.tools.animation": "1.0.0", "com.example.tools.physics": "1.0.0", "com.example.animation": "1.0.0" } }
When the Package Manager decides which registry to fetch a package from, it compares the package name to the scopes values and finds the registry whose scopes value is the closest match.
com.example.animation
package, it finds that the com.example
namespace is the closest match to its name, and fetches that package from the General
registry.com.example.tools.physics
package, the General
registry has a scope that exactly matches the package name.com.example.mycompany.tools.animation
package, the Package Manager finds that the com.example.mycompany.tools
namespace is the closest match to its name and fetches that package from the Tools
registry. Although it also matches the General
scope, the com.example
namespace isn’t as close a match.com.unity.animation
package, the Package Manager doesn’t find a match in any of the scoped registries. In this case, it fetches the package from the default registry.If the General
and Tools
registries have built-in packagesBuilt-in packages allow users to toggle Unity features on or off through the Package Manager. Enabling or disabling a package reduces the run-time build size. For example, most projects don’t use the legacy Particle System. By removing the abstracted package of this feature, the related code and resources are not part of the final built product. Typically, these packages contain only the package manifest and are bundled with Unity (rather than available on the package registry).
See in Glossary that also exist in the Editor, the Package Manager resolves them as follows:
General
scoped registry because the overrideBuiltIns
value is false
. Instead, the Package Manager uses the built-in version included with the Unity Editor.Tools
scoped registry instead of the Editor because the overrideBuiltIns
value is true
.Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.