Specify Docs
Specify ↗︎Changelog ↗︎Guide ↗︎
V2
V2
  • Getting started
    • Introduction
    • What is Specify?
    • Pulling your first tokens with the CLI
    • Glossary
  • Collect
    • What is a Source?
    • Available sources
      • Figma Variables & Styles
      • Tokens Studio
  • Distribute
    • What is a Destination?
    • Available destinations
      • GitHub
      • Specify CLI
      • Specify SDK
      • HTTP API
  • Concepts
    • Overview
    • Parsers Engine
    • SDTF Client
      • SDTF Engine
    • Specify Design Token Format
  • Guides
    • Configuration file 101
    • Specify CLI usage 101
      • Getting started
      • Authentication
      • Generate Files
    • Specify SDK usage 101
      • Getting started
      • Retrieving and working with the tokens
      • Updating tokens
      • Converting a token to XXX
      • Executing generation parsers
    • Specify SDK Cheatsheet
    • Manage font files
    • Querying a SDTF graph
  • Reference
    • Parsers Engine
    • Parsers
      • change-case
      • convert-color
      • convert-dimension
      • make-line-height-relative
      • filter
      • register-view
      • select-modes
      • prefix-by
      • suffix-by
      • replace-string
      • to-css-custom-properties
      • to-css-text-style
      • to-css-font-import
      • to-flutter
      • to-javascript
      • to-json
      • to-json-list
      • to-kotlin
      • to-react-native
      • to-scss-mixin-text-style
      • to-scss-map
      • to-sdtf
      • to-style-dictionary
      • to-swift
      • to-tailwind
      • to-typescript
      • svgo
      • svg-to-jsx
      • svg-to-tsx
      • to-svg-file
      • to-bitmap-file
      • to-file
    • Specify SDK
      • SpecifyClient
      • SDTFClient
      • Converters
        • CSS
      • ParsersEngineResults
    • SDTF Engine
      • Query API
      • Mutation API
      • SDTF Query Language
      • SDTF QueryResult
      • TokenState
        • Stateful Value
    • HTTP API
      • POST /parsers-engine-rpc
    • Specify CLI
  • Resources
    • Parser Rules templates
      • CSS Custom Properties
      • Tailwind
      • React Native
      • Flutter
      • SDTF
      • JSON
    • Specify CLI VS Specify SDK
    • Playground
    • Best practices
  • Useful links
    • Discord
    • YouTube
    • Twitter
    • Help Center
    • Canny
Powered by GitBook
On this page
  • Introduction
  • Overview
  • The Specify Client API
  • The SDTF Client API
  • Mutate the token tree locally
  • Convert tokens to XXX

Was this helpful?

Export as PDF
  1. Concepts

SDTF Client

Step into the Specify SDK APIs to get fined grained access to your design data.

Introduction

The Parsers Engine produces finite and opinionated outputs, but sometimes you need to have more control over our generated files.

That's where the SDTF Client takes over and provide plenty of methods to work with any SDTF token tree.

Looking for how to get started with the SDK? 👉 heads up to the Specify SDK usage 101 guide.

Overview

The SDTF Client offers versatile methods for working with SDTF token trees, enabling data manipulation, transformation, and conversion into various formats or languages, bridging the gap between stored and live token instances within your repository.

To access your organization data, you use the Specify Client API. You can then fetch a repository and use the SDTF Client API to manipulate the data and transform to your desired custom format.

The SDTF Client API wraps up the SDTF Engine which holds the lower level methods to work with the token tree.

The Specify Client API

The Specify Client manages:

  • your authentication credentials - personal access token

  • your access to your organization repositories

The SDTF Client API

The SDTF Client bridges the gap between the raw token tree stored into your repository - in Specify database - and the live token tree instance provided by the SDK.

Mutate the token tree locally

Since the client is instantiated locally, all changes made to the token tree are only affecting the current version of the client.

You can create several instances of the same initial token tree - using clone()

Then, create several updates:

  • with predefined formatters using update()

  • with cherry-picking of a sub-tree using pick()

  • with custom implementation using forEachTokenState()

  • and many more

Convert tokens to XXX

Converting tokens is always a matter of iterating over the tokens of your tree and decide what to do with their value(s), their modes and potential aliases.

Looking for usage? 👉 heads up to the Convert a token to XXX guide.

PreviousParsers EngineNextSDTF Engine

Last updated 1 year ago

Was this helpful?