> For the complete documentation index, see [llms.txt](https://xreal.gitbook.io/nrsdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xreal.gitbook.io/nrsdk/v2.1.0/development/spatial-anchor/tutorial-sharing-anchors.md).

# Tutorial: Sharing Anchors

### **Introduction**

Sharing anchors between devices is essential for multi-user AR experiences. This tutorial will guide you through the process of sharing anchors by using Photon to transmit anchor UUIDs in real-time and cloud storage to persistently store the anchor data.

At a high level, the process works as follows:

1. When a user creates an anchor, its UUID is sent to other users in the same Photon room.
2. The anchor data is then stored in a cloud storage solution.
3. Other users in the room, upon receiving the UUID, access the cloud storage to download the anchor data.
4. Once downloaded, the anchor is loaded into their AR scene, effectively sharing the anchor across devices.

For the cloud storage part, any cloud storage provider that allows file upload and download can be used. In this tutorial, we provide examples for two cloud storage solutions:&#x20;

* Firebase &#x20;
* Alibaba Cloud OSS.&#x20;

The methods for other providers should be similar, and developers are encouraged to explore the options that best suit their needs.

### **Prerequisites**

* Unity with NRSDK 2.1 installed.
* Photon Unity Networking 2 (PUN 2) package.
* Firebase Unity SDK.

### All Materials Needed in This Tutorial

{% hint style="info" %}
The following package includes all the necessary scene and the majority of the scripts required for this tutorial. However, it's important to note that developers will still need to complete the steps related to [photon](/nrsdk/v2.1.0/development/spatial-anchor/tutorial-sharing-anchors/setting-up-photon.md) and cloud storage themselves.

Additionally, due to the tutorial's involvement with modifications to the built-in scripts of NRSDK, specifically NRWorldAnchor.cs and NRWorldAnchorStore.cs, these changes cannot be included within this package. Please refer to the tutorial's content, specifically in the section on '[Implementing Cloud Save and Load](/nrsdk/v2.1.0/development/spatial-anchor/tutorial-sharing-anchors/implementing-cloud-save-and-load.md),' to make the necessary modifications.
{% endhint %}

{% file src="/files/YcgCRYjD0v2Iig7gzH81" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xreal.gitbook.io/nrsdk/v2.1.0/development/spatial-anchor/tutorial-sharing-anchors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
