***

title: addSwaigQueryParams
slug: /reference/typescript/agents/agent-base/add-swaig-query-params
description: Append query parameters to all SWAIG webhook URLs.
max-toc-depth: 3
---------------------

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

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

Add query parameters that will be included in all SWAIG webhook URLs generated by
this agent. This is particularly useful for preserving dynamic configuration state
across SWAIG callbacks -- for example, passing a tenant identifier or feature tier
so the same configuration is applied when SignalWire invokes tool webhooks.

## **Parameters**

<ParamField path="params" type={"Record<string, string>"} required={true} toc={true}>
  Object of query parameters to merge into every SWAIG URL. Subsequent calls merge
  into (not replace) the existing set. Pass the same key again to overwrite its value.
</ParamField>

## **Returns**

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

## **Example**

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

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

agent.setDynamicConfigCallback(async (queryParams, bodyParams, headers, agentCopy) => {
  const tier = queryParams.tier ?? 'free';
  if (tier === 'premium') {
    agentCopy.setParams({ end_of_speech_timeout: 500 });
  }
  agentCopy.addSwaigQueryParams({ tier });
});

await agent.serve();
```