+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "getTemplateSrv"
keywords = ["grafana","documentation","sdk","@grafana/runtime"]
type = "docs"
+++

## getTemplateSrv variable

### getTemplateSrv variable

Used to retrieve the [TemplateSrv](./runtime/templatesrv.md) that can be used to fetch available template variables.

<b>Signature</b>

```typescript
getTemplateSrv: () => TemplateSrv
```
<b>Import</b>

```typescript
import { getTemplateSrv } from '@grafana/runtime';
```
