4.0.1 • Published 3 years ago

@basis-theory/basis-theory-elements-interfaces v4.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

⚠️⚠️ This package has been deprecated ⚠️⚠️

Since v1.27.0, Basis Theory JS SDK embeds all required types.

Example:

- import type { Token } from '@basis-theory/basis-theory-elements-interfaces/models';
+ import type { Token } from '@basis-theory/basis-theory-js/types/models';

Basis Theory Elements Interfaces

Version Verify

This package exposes TypeScript definitions for Basis Theory JS SDK features, including Elements.

Installation

Using Node Package Manager

npm install --save-dev @basis-theory/basis-theory-elements-interfaces

Using Yarn

yarn add --dev @basis-theory/basis-theory-elements-interfaces

Usage

Types are exported from the following locations.

Models

import { BasisTheory } from '@basis-theory/basis-theory-js';
import type { Application } from '@basis-theory/basis-theory-elements-interfaces/models'; // <- models root

const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED'); // replace with your application key

const application: Application = await bt.applications.retrieve('fe1f9ba4-474e-44b9-b949-110cdba9d662');

SDK

import { BasisTheory } from '@basis-theory/basis-theory-js';
import type { PaginatedList, ListLogQuery } from '@basis-theory/basis-theory-elements-interfaces/sdk'; // <- sdk root
import type { Log } from '@basis-theory/basis-theory-elements-interfaces/models';

const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED'); // replace with your application key

let query: ListLogQuery = {
  entityType: 'application'
};

if (someCondition) {
  query = {
    ...query,
    entityId: '3f86930c-18f3-4a2d-b033-b738e59d419e'
  }
}

const logs: PaginatedList<Log> = await bt.logs.list(query);

Elements

import { BasisTheory } from '@basis-theory/basis-theory-js';
import type { TextElement } from '@basis-theory/basis-theory-elements-interfaces/elements'; // <- elements root

const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED', { elements: true }); // replace with your application key

const myInput: TextElement = bt.createElement('text', { targetId: 'myInputId' });
4.0.1

3 years ago

4.0.0

3 years ago

3.8.0

3 years ago

3.7.0

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

1.0.0-alpha.19

4 years ago