@andymuniz/pokemon-tcg-sdk-typescript
v0.3.0
Published
Unofficial TypeScript SDK for the Pokemon TCG API. (https://pokemontcg.io)
Downloads
12
Readme
Pokemon TCG SDK
This is an unofficial TypeScript SDK for the Pokemon TCG API.
Installation
npm
npm install @andymuniz/pokemon-tcg-sdk-typescript
Usage
import { PokemonTcgApiClient } from "@andymuniz/pokemon-tcg-sdk-typescript";
// Create a client
const client = new PokemonTcgApiClient();
// Set API key (optional but recommended)
client.setApiKey("your-api-key");
// Search for cards
client.card
.search({ q: "name:charizard", orderBy: ["name"] })
.then(console.log);
// Find a card by ID
client.card.find("xy1-1").then(console.log);
// Get a list of cards.
// Order by name then number descending.
// Return only the "name" and "number" fields.
client.card
.search({
orderBy: ["name", "-number"],
select: ["name", "number"],
})
.then(console.log);