Specify SDK Cheatsheet
On this page you'll find a lot of common actions you'll probably want to perform when using the SDK
Creating Specify and SDTF clients
import { createSpecifyClient } from "@specifyapp/sdk";
const specifyClient = createSpecifyClient();
await specifyClient.authenticate("<YOUR_PERSONAL_ACCESS_TOKEN_VAR>");
const sdtfClient =
await specifyClient.getSDTFClientByRepositoryName("<YOUR_SPECIFY_REPO_NAME>");
console.log('Repository name',sdtfClient.repository.name)Updating tokens
import { updaters } from '@specifyapp/sdk'
sdtfClient.update(
updaters.color({ toFormat: 'hex' }, { where: { token: '^color-' }}),
);Convert a token to XXX
Execute a parser
Retrieving data
Get a specific token
Get all the tokens
Map over all the tokens
Get a specific group
Get all the groups
Map over all the groups
Get a specific collection
Get all collections
Map over all the collections
Filtering data
Keeping a sub-graph from a path
Keeping the children of a path
Query a specific set of data
Remove tokens from the SDTF
Renaming tokens
Rename a node
Rename a collection
Rename a group
Rename a token
Last updated
Was this helpful?