You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Florian Bouillon e182ec5617 Update 'renovate.json' 1 week ago
interfaces Updated sdk to 1.3.0 3 weeks ago
translations V1 1 month ago
.editorconfig V1 1 month ago
.gitignore V1 1 month ago
.npmignore V1 1 month ago
LICENSE.md V1 1 month ago
README.md Made Better REAADME 1 month ago
Request.ts Updated sdk to 1.3.0 3 weeks ago
TranslationUtil.ts Fixed warning for translations 2 weeks ago
package.json v1.4.0 2 weeks ago
renovate.json Update 'renovate.json' 1 week ago
tcgdex.ts Added a default Language setting for global lang 2 weeks ago
tsconfig.json V1 1 month ago
yarn.lock V1 1 month ago

README.md

TCGdex Javacript SDK

Install

Yarn/npm

yarn add @tcgdex/sdk

or with npm

npm install @tcgdex/sdk

Usage

Note: a complete documentation is in progress

import TCGdex from '@tcgdex/sdk'
import TranslationUtil from '@tcgdex/sdk/TranslationUtil'
import Tag from '@tcgdex/sdk/interfaces/Tag'

// init the class
const tcgdex = new TCGdex("en") // Lang code (Optionnal) (See TranslationUtil.ts line 3)

// change lang
tcgdex.lang = "fr"

// get Card object wih global id
await tcgdex.getCard("base1-1")

// get Card object with local id and set
await tcgdex.getCard(1, "base1")

// get Set informations
await tcgdex.getSet("base1")

// get Expansion
await tcgdex.getExpansion("base")

// Translate information from code to the lang
TranslationUtil.translate("tag", Tag.STAGE2, "en")