hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
70 lines (33 loc) • 1.01 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [PersistenceManager](./server.persistencemanager.md) > [setGlobalData](./server.persistencemanager.setglobaldata.md)
## PersistenceManager.setGlobalData() method
Set global data in the data persistence service. This data is available and shared by all lobbies of your game.
**Signature:**
```typescript
setGlobalData(key: string, data: Record<string, unknown>): Promise<Record<string, unknown> | void>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
key
</td><td>
string
</td><td>
The key to set the data to.
</td></tr>
<tr><td>
data
</td><td>
Record<string, unknown>
</td><td>
The data to set.
</td></tr>
</tbody></table>
**Returns:**
Promise<Record<string, unknown> \| void>