# Function: withQueryParams()

> **withQueryParams**(`url`, `params?`): `string`

Defined in: [helpers/url.ts:16](https://github.com/coda/packs-sdk/blob/44f7744bb692307d51cf2020a7058f343a7e25e8/helpers/url.ts#L16)

Helper to create a new URL by appending parameters to a base URL.

The input URL may or may not having existing parameters.

## Example

```
// Returns `"/someApi/someEndpoint?token=asdf&limit=5"`
let url = withQueryParams("/someApi/someEndpoint", {token: "asdf", limit: 5});
```

## Parameters

| Parameter | Type | | --- | --- | | `url` | `string` | | `params?` | {\[`key`: `string`\]: `any`; } |

## Returns

`string`
