2021-08-12 21:59:29 +02:00
2021-06-22 20:27:25 +02:00
2021-06-22 21:40:28 +02:00
2021-08-12 21:59:11 +02:00
2021-07-11 15:18:44 +00:00
2021-06-22 20:27:25 +02:00
2021-06-22 21:40:28 +02:00
2021-06-22 19:54:38 +02:00
2021-06-22 20:27:25 +02:00
2021-07-19 14:47:47 +02:00
2021-03-11 10:10:44 +01:00
2021-08-12 21:59:29 +02:00
2021-08-12 21:59:29 +02:00
2021-07-19 15:07:41 +02:00
2021-07-19 14:44:58 +02:00

NOM Version NPM Downloads npm version the TCGdex JAvascript SDK is released under the MIT license. the TCGdex JAvascript SDK is released under the MIT license. Discord Link

TCGdex JavaScript/TypeScript SDK

Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK

Full API/SDK documentation in progress at https://www.tcgdex.net/docs

Getting Started

Install the SDK using:

yarn add @tcgdex/sdk
# or
npm install @tcgdex/sdk

or in the web browser

<script src="https://cdn.jsdelivr.net/npm/@tcgdex/sdk@2/dist/tcgdex.browser.js"></script>

Usage

Note: a complete documentation is in progress

// only if using with NPM/Yarn
import TCGdex from '@tcgdex/sdk'

// initialize the SDK
const tcgdex = new TCGdex('en') // Lang code (Optionnal) (See interfaces.ts line 1 for supported languages)

// if you need to change the language
tcgdex.lang = 'fr'

// get a Card using its global ID
await tcgdex.fetch('cards', 'base1-1')

// fetch a Card using it's local id and set name/ID
await tcgdex.fetch('sets', 'Base Set', 1)

// fetch a Set's informations using the set's name/ID
await tcgdex.fetch('sets', 'Sword & Shield')

// Fetch a serie using the serie's name/ID
await tcgdex.fetch('series', 'Black & White')

// Fetch cards using other endpoints
/**
 * categories => the the different cards categories
 * hp => fetch the different cards possible HPs
 * illustrators => fetch all the cards illustrators
 * rarities => fetch the cards rarities
 * retreats => fetch the cards using the retreat count
 * types => fetch the cards using the Pokémon type(s)
 **/
await tcgdex.fetch('categories')
Description
Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK
Readme 1.9 MiB
Languages
TypeScript 99.1%
JavaScript 0.9%