@tokens-studio/sdk v2.0.2
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.
3 months ago
3 months ago
4 months ago
5 months ago
6 months ago
6 months ago
8 months ago
11 months ago
10 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago