Abstract SDK

Abstract SDK

  • Getting started
  • API Reference

›Getting Started

Getting Started

  • Installation
  • Authentication
  • Configuration
  • Usage

Concepts

  • Rate limits
  • Transports
  • Pagination
  • Webhooks
  • Webhooks Security
  • Full Responses
  • Latest commits
  • Embeds

API Reference

  • Client
  • Sketch
Edit

Authentication

Authentication with the SDK uses OAuth access tokens that are generated using the Abstract web application.

Access tokens should be treated like passwords, as they enable access to all data that a given account can access. Do not commit them to version control.

Generating an access token

  1. Visit the access token settings page.
  2. Click the Create API Token button.
  3. Name the token descriptively and save it.

Create a token

After creating an access token, copy it to the clipboard to save to a different location, like an ABSTRACT_TOKEN environment variable. It's important to actually save the access token and to give it a descriptive name: after initial creation, the underlying value won't be visible again.

Using an access token

If an access token is available in a given environment as an ABSTRACT_TOKEN variable, the SDK will automatically use it without any additional configuration. It's also possible to explicitly pass in an access token using the accessToken configuration option.

An access token can be passed directly as a string.

const client = new Abstract.Client({
  accessToken: process.env.DEMO_TOKEN
});

An access token can also be passed as either a synchronous or an asynchronous function that returns a string.

const client = new Abstract.Client({
  accessToken: async () => getDemoToken()
});

See Configuration for more information.

← InstallationConfiguration →
  • Generating an access token
  • Using an access token
Copyright © 2021 Elastic Projects