Newbie Paintball Master

    @basis-theory/basis-theory-js
    TypeScript icon, indicating that this package has built-in type declarations

    1.42.0 • Public • Published

    Basis Theory JS SDK (aka BasisTheory.js)

    Version Verify

    The Basis Theory JS SDK

    Installation

    Using Node Package Manager

    npm install --save @basis-theory/basis-theory-js

    Using Yarn

    yarn add @basis-theory/basis-theory-js

    Documentation

    For a complete list of endpoints and examples, please refer to our API docs

    Usage

    Initialization

    import { BasisTheory } from '@basis-theory/basis-theory-js';
    
    const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED'); // replace with your application key

    Per-request configuration

    All of the service methods accept an optional RequestOptions object. This is used if you want to set a correlation ID or if you want to set a per-request BT-API-KEY

    import { v4 as uuid } from 'uuid';
    
    await bt.applications.list(
      {},
      {
        apiKey: 'key_N88mVGsp3sCXkykyN2EFED',
        correlationId: 'aa5d3379-6385-4ef4-9fdb-ca1341572153',
      }
    );

    Setting a custom API Url

    You can set a custom API Url to be used across all clients when creating a new SDK instance.

    import { BasisTheory } from '@basis-theory/basis-theory-js';
    
    const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED', {
      apiBaseUrl: 'https://api.somedomain.com',
    }); // replace with your application key and api base URL.

    Elements

    Please, refer to the Elements Documentation on how to use it.

    Development

    The provided scripts with the SDK will check for all dependencies, start docker, build the solution, and run all tests.

    Dependencies

    Build the SDK and run Tests

    Run the following command from the root of the project:

    make verify

    Keywords

    none

    Install

    npm i @basis-theory/basis-theory-js

    DownloadsWeekly Downloads

    962

    Version

    1.42.0

    License

    Apache-2.0

    Unpacked Size

    137 kB

    Total Files

    167

    Last publish

    Collaborators

    • justjordant
    • jleon15
    • lcschy
    • briangonzalezatbt
    • adamletizia
    • dhudec
    • davi.basistheory
    • armsteadj1
    • bweber36
    • matthew_basistheory
    • bt-platform