Skip to content

v0.2.0

Compare
Choose a tag to compare
@rattrayalex rattrayalex released this 01 Jun 17:25
· 678 commits to main since this release

API Keys & client instantiation

This release changes the recommended way of passing your API Key to read from a LITHIC_API_KEY environment variable:

import Lithic from 'lithic';

// old, deprecated:
const lithic = Lithic('my api key');

// new:
const lithic = Lithic(); // automatically reads LITHIC_API_KEY environment variable
// or:
const lithic = Lithic({apiKey: 'my api key'});

We recommend using dotenv to set up secret keys as environment variables.

Optional params

This release lets you pass request options without an empty params object for methods with optional params:

// before:
client.transactions.list({}, {timeout: 5 * 1000});
// now:
client.transactions.list({timeout: 5 * 1000});

Removal of deprecated methods

The deprecated autoPagingEach() and autoPagingToArray() methods have been removed.

Other

This release also:

  • Improves the readability of doc comments, especially for enums.
  • Includes several small improvements to the mapping of types to actual API behavior, and updates to reflect new API behavior.
  • Makes changes to the structure of some types, such as sharing a ShippingAddress type across many API resources.
  • Fixes a bug with AuthStreamEnrollment