> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/reference/data-sources/vectortilesetsource.md).

# vectorTilesetSource

You can use **vectorTilesetSource** to build layers and widgets using **pre-generated CARTO tilesets** stored in your data warehouse that contain:

* **Vector data:**
  * points,
  * lines,
  * polygons
  * etc...

## Usage

```typescript
import {vectorTilesetSource} from '@carto/api-client';

const data = vectorTilesetSource({
  accessToken: 'XXX',
  connectionName: 'carto_dw',
  tableName: 'carto-demo-data.demo_tilesets.sample_tileset'
});
```

## Options

```typescript
type VectorTableSourceOptions = {
  tableName: string;
  widgetWorker?: boolean;
};
```

* **tableName**: The fully qualified name (FQN) of the tileset you want to retrieve from your data warehouse. For example, for a BigQuery connection, `carto-demo-data.demo_tables.sample_tileset` would be a valid table name.
* **widgetWorker** (optional): A boolean that enables or disables the use of Web Workers to perform [clent-side calculations](/carto-for-developers/reference/carto-widgets-reference/server-side-vs.-client-side.md#client-side-widget-calculation) for [widgets](/carto-for-developers/reference/carto-widgets-reference.md).

## Response

The response of `vectorTilesetSource` is a promise that can be resolved and used in [layers](https://github.com/CartoDB/gitbook-documentation/blob/master/carto-for-developers/key-concepts/carto-for-deck.gl) and [widgets](/carto-for-developers/reference/carto-widgets-reference.md).

## Connection compatibility

| Connection Data Warehouse                                                      | Compatible           |
| ------------------------------------------------------------------------------ | -------------------- |
| [BigQuery](/carto-user-manual/connections/bigquery.md)                         | :white\_check\_mark: |
| [Snowflake](/carto-user-manual/connections/snowflake.md)                       | :white\_check\_mark: |
| [Redshift](/carto-user-manual/connections/redshift.md)                         | :white\_check\_mark: |
| [Databricks](/carto-user-manual/connections/databricks.md)                     | :white\_check\_mark: |
| [Oracle](/carto-user-manual/connections/oracle.md)                             | :x:                  |
| [PostgreSQL](/carto-user-manual/connections/postgresql.md)                     | :white\_check\_mark: |
| [CARTO Data Warehouse](/carto-user-manual/connections/carto-data-warehouse.md) | :white\_check\_mark: |

## Layer compatibility

`vectorTableSource` is compatible with the following layers from the `@deck.gl/carto` module:

* [VectorTileLayer](https://deck.gl/docs/api-reference/carto/vector-tile-layer)

## Widget model compatibility

`vectorTableSource` is compatible with the following widget models:

* [getFormula](/carto-for-developers/reference/carto-widgets-reference/models/getformula.md)
* [getCategories](/carto-for-developers/reference/carto-widgets-reference/models/getcategories.md)
* [getHistogram](/carto-for-developers/reference/carto-widgets-reference/models/gethistogram.md)
* [getRange](/carto-for-developers/reference/carto-widgets-reference/models/getrange.md)
* [getScatter](/carto-for-developers/reference/carto-widgets-reference/models/getscatter.md)
* [getTimeSeries](/carto-for-developers/reference/carto-widgets-reference/models/gettimeseries.md)
* [getTable](/carto-for-developers/reference/carto-widgets-reference/models/gettable.md)

{% hint style="warning" %}
Widget models for tilesets are calculated client side. Precision might be lower, especially at low zoom levels (ie: when covering a large surface of the earth). [Learn more about client-side widget calculations](/carto-for-developers/reference/carto-widgets-reference/server-side-vs.-client-side.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-for-developers/reference/data-sources/vectortilesetsource.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
