# SDTF Engine

## Instances

The SDTF Engine can be accessed in:

* the `@specifyapp/sdk` package, by using the `specifyClient.getRepositoryTokenTree` method.
* the `@specifyapp/specify-design-token-format` package, by using the exported `createSDTFEngine` function.

## Public API

```
sdtfEngine.[method]
```

### Query methods

The [Query API](https://docs.specifyapp.com/reference/sdtf-engine/query-api) provides methods for locally accessing and iterating the token tree.

### Query runner

The [SDTF Query Language](https://docs.specifyapp.com/reference/sdtf-engine/sdtf-query-language) is used into the `sdtfEngine.query.run(query: SDTFQuery)`

### Mutation methods

The [Mutation API](https://docs.specifyapp.com/reference/sdtf-engine/mutation-api) provides methods for locally mutating the token tree.

### Top level

#### `renderJSONTree`

Get the JSON representation of the token tree.

```typescript
function renderJSONTree(param: {
  renderOptions:
    | {
        resolveAliases: true;
        allowUnresolvable?: AllowUnresolvable;
        targetMode?: TargetMode;
      }
    | { resolveAliases: false };
}): JSON;
```
