***

title: updateGlobalData
slug: /reference/typescript/agents/agent-base/update-global-data
description: Merge additional entries into the existing global data object.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[set-global-data]: /docs/server-sdks/reference/typescript/agents/agent-base/set-global-data

[ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base

Merge additional entries into the existing global data object. Unlike
[`setGlobalData()`][set-global-data] which replaces, this method merges so that
multiple callers (skills, dynamic config callbacks, etc.) can each contribute keys
without overwriting each other.

## **Parameters**

<ParamField path="data" type={"Record<string, unknown>"} required={true} toc={true}>
  Object of key/value pairs to merge into global data.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns `this` for method chaining.

## **Example**

```typescript {8}
import { AgentBase } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'greenhouse', route: '/greenhouse' });
agent.setPromptText('You are a helpful plant care assistant.');

// Update global data with caller-specific information
const user = { name: 'Alice', tier: 'gold' };
agent.updateGlobalData({
  authenticated: true,
  user_name: user.name,
  user_tier: user.tier,
});

await agent.serve();
```