Aller au contenu

The JavaScript SDK

Ce contenu n’est pas encore disponible dans votre langue.

NPM VersionGithub starsNPM Downloadsnpm versionthe TCGdex JAvascript SDK is released under the MIT license.

Installation

Terminal window
npm i @tcgdex/sdk

Usage

// Import the SDK in moduleJS
import TCGdex from '@tcgdex/sdk'
// OR import the SDK in commonJS
const TCGdex = require('@tcgdex/sdk').default
// Instantiate the SDK
const tcgdex = new TCGdex('en');
// go into an async context
(async () => {
// Card will be Furret from the Darkness Ablaze Set
const card = await tcgdex.fetch('cards', 'swsh3-136');
})();

You can check in the JSON REST API docs and select the correct tab to see the command specific for your SDK

Source Code

The source code for the SDK is available on Github !