feat: scalar-typescript-sdk-rust@0.2.2#3
Open
marclave wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scalar API
API for managing Scalar platform resources.
TypeScript SDK
For TypeScript, we provide a SDK that makes using our API even easier.
Install
Get a Scalar API key
Create an API key in your Scalar account:
.env, for example:Exchange your API key for an access token
The personal token is not an access token. Exchange it first with
postv1AuthExchange.If you use the personal token directly for authenticated API calls, the API returns
401 Invalid authentication token.Use the access token
Construct a second client with bearer auth. Use this authenticated client for API calls.
Notes
new Scalar()).Read more
Installation
Usage
The client is asynchronous and built on
tokio+reqwest. Construct itwith the builder, or read credentials from the environment:
Every operation returns a request builder; set optional parameters fluently
and finish with
.send().await:Authentication
Credentials can be set on the builder or read from the environment by
from_env:bearer_token— environment variableSCALAR_BEARER_TOKENError handling
Fallible operations return [
scalar_scalar_typescript_sdk::Error]. Match on theresult of
send().awaitto distinguish API errors (with status and decodedbody) from transport and decoding failures:
API reference
See
api.mdfor the full list of resources and operations.Contributions
This SDK is generated programmatically. Manual edits to generated files will be
overwritten on the next build.
SDK created by Scalar