2.0.2 • Published 3 months ago

@tokens-studio/sdk v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Token Studio SDK

This is the official SDK for Tokens Studio.

View technical diagram which we created to showcase how the SDK & CLI work, how to create an API key, and how you can use the GraphQL Apollo Sandbox environment to play around with our API and run regular HTTP requests against it to query or mutate data.

Quickstart

Installation

npm install @tokens-studio/sdk

CLI

See help menu for usage of the CLI.

npx tokensstudio --help
npx tokensstudio setup --help
npx tokensstudio pull --help

Example pulling tokens into local filesystem, after having created and filled a .tokensstudio.json file in the current working directory through the setup command:

TOKENS_STUDIO_API_KEY=your_api_key npx tokensstudio setup
TOKENS_STUDIO_API_KEY=your_api_key npx tokensstudio pull

Note: if you don't pass an environment variable for the API key, the CLI will prompt you for it instead.

Which will pull the tokens from your configured org, project and branch, assuming the API key has read permissions to the tokensets in that project.

.tokensstudio.json Example

{
	"version": "2",
	"org": "1f15691a-1d96-4049-bd53-943c869ce827",
	"project": "bd5e89d5-96f3-441a-bf9c-6041d5eccebc",
	"branch": "main",
	"release": "",
	"output": "tokens"
}

release is optional and WIP for now. Once we have releases, you can specify it so it can pull the release artifacts for you.

Local backend

For Studio devs that run the Studio App backend locally:

TOKENS_STUDIO_API_KEY=api_key_test npx tokensstudio pull --host localhost:4200 --insecure

If your API key was created through seeding rather than in the frontend app itself, ensure you associate the key with the correct user in the database (e.g through Prisma Studio).

Contributing

When running tests, ensure that you run the build step first because the tests run the compiled CLI directly as a way to test end to end.

Underlying GraphQL documentation

See the documentation for the GraphQL API here.

Documentation

See the documentation site for more info.

ESM

This library is ESM by default. We do not compile to CommonJS.

Type secure

The entire library is built with TypeScript and provides multiple utilities to ensure type safety.

License

This repository is published under the MIT license.

2.0.2

3 months ago

2.0.1

3 months ago

2.0.0

4 months ago

1.4.2

5 months ago

1.4.1

6 months ago

1.4.0

6 months ago

2.0.0-alpha.0

8 months ago

1.2.0

11 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago

0.1.51-alpha.0

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.1.50-alpha.0

2 years ago

0.1.49-alpha.0

2 years ago

0.1.41-alpha.0

2 years ago

0.1.42-alpha.0

2 years ago

0.1.32-alpha.0

2 years ago

0.1.40-alpha.0

2 years ago

0.1.39-alpha.0

2 years ago

0.1.33-alpha.0

2 years ago

0.1.34-alpha.0

2 years ago

0.1.28-alpha.0

2 years ago

0.1.20-alpha.0

2 years ago

0.1.21-alpha.0

2 years ago

0.1.35-alpha.0

2 years ago

0.1.30-alpha.0

2 years ago

0.1.19-alpha.0

2 years ago

0.1.31-alpha.0

2 years ago

0.1.1-alpha.0

2 years ago

0.0.0-alpha.0

2 years ago