Client Configuration
Learn how to initialize and configure the JustTCG client for your application.
Basic Initialization
The simplest way to initialize the client is without any parameters. The SDK will automatically look for the JUSTTCG_API_KEY
environment variable.
import { JustTCG } from 'justtcg-js';
// Automatic environment variable detection
const client = new JustTCG();
Recommended Approach: Using environment variables is the most secure and convenient method for production applications.
Direct API Key
You can also provide the API key directly in the constructor:
import { JustTCG } from 'justtcg-js';
// Direct API key injection
const client = new JustTCG({
apiKey: 'your_api_key_here'
});
Security Warning
Avoid hardcoding API keys in your source code. Use environment variables or secure secret management systems instead.
Next Steps
Now that you understand client configuration, you can: