Add the Pokémon client
Fetch Pokémon data in your Pandium TypeScript integration by installing a Pokédex client, initializing it in code, and calling it to retrieve a test Pokémon before wiring real logic.
import * as dotenv from 'dotenv'
dotenv.config()
import Pokedex from 'pokedex-promise-v2'
import { Config, Secret, Context } from './lib.js'
const run = async () => {
const context = new Context()
const secrets = new Secret()
const config = new Config()
console.error(`This run is in mode: ${context['run_mode']}`)
console.error('------------------------CONFIG------------------------')
console.error(config)
console.error('------------------------CONTEXT------------------------')
console.error(context)
const pokeClient = new Pokedex()
const tyranitar = await pokeClient.getPokemonByName('tyranitar')
console.error(tyranitar)
}
run().then(
() => {},
() => {
process.exitCode = 1
}
)Last updated
Was this helpful?