0.0.23 • Published 8 months ago

@fern-api/stackone v0.0.23

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

StackOne Node Library

npm shield fern shield

The StackOne Node.js library provides access to the StackOne API from JavaScript/TypeScript.

Documentation

API reference documentation is available here.

Usage

Try it out

import { StackOneClient } from '@fern-api/stackone';

const stackOne = new StackOneClient({
  username: 'YOUR_USERNAME_HERE',
  password: 'YOUR_PASSWORD_HERE',
});

const account = await stackOne.crm.accounts.get('account-id');

console.log('Got account!', account);

Hierarchial SDK Structure

The SDK is hierarchically constructed and supports operations for HRIS, ATS, CRM and Marketing.

stackOne.hris. // Opertions within the HRIS category

stackOne.ats. // Opertions within the ATS category

Handling Errors

When the API returns a non-success status code (4xx or 5xx response), a subclass of StackOneError will be thrown:

import { StackOneClient, StackOneError } from "@fern-api/stackone";

try {
  await stackOne.crm.accounts.get('account-id');
} catch (err) {
  if (err instanceof StackOneError) {
    console.log(err.statusCode); 
    console.log(err.message);
    console.log(err.body); 
  }
}

Request Options

The HTTP Client accepts a RequestOptions class where you can specify a customized timeout.

const transcript = await aai.transcript.get("transcript-id", {
    timeoutInSeconds: 60 // increase timeout in seconds
});

Retries

The SDK is configured to retry requests up to 5 times with exponential backoff.

Checkout the relevant code sample here.

Beta status

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your package.json file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago