JavaScript REST API Client

Install

npm install @autoblocks/client

AutoblocksAPIClient

The AutoblocksAPIClient allows you to interact with the Autoblocks REST API. It can be initialized without any arguments if your API key is set as an environment variable named AUTOBLOCKS_API_KEY.

JavaScript

import { AutoblocksAPIClient } from '@autoblocks/client';

const client = new AutoblocksAPIClient();

Otherwise, you can pass the API key as an argument:

Python

const client = new AutoblocksAPIClient({
  apiKey: 'your-api-key',
});

There are additional arguments that you can use to further configure the client:

  • Name
    timeout
    Type
    object | undefined
    Description

    The timeout for each HTTP request to the Autoblocks REST API. Default value is { seconds: 10 }.

JavaScript

const client = new AutoblocksAPIClient({
  timeout: { seconds: 30 },
});

See the REST API documentation for more details on all of the endpoints exposed through this client.