You can provide your API key using the CHANNEL3_API_KEY environment variable, or by passing it directly to the client.
import Channel3 from "@channel3/sdk";// Initialize with environment variableconst client = new Channel3();// Or, initialize with API key directlyconst clientWithKey = new Channel3({ apiKey: "your_api_key_here",});
from channel3_sdk import Channel3, AsyncChannel3# Initialize with environment variableclient = Channel3()# Or, initialize with API key directlyclient_with_key = Channel3(api_key="your_api_key_here")# Async clientasync_client = AsyncChannel3()
Set a default locale once on the client and it’ll apply to every search and product detail call. Per-call values (e.g. config.country on search, ?country= on product detail) override the client default.
import Channel3 from "@channel3/sdk";const client = new Channel3({ country: "GB", currency: "GBP",});// Uses GB / GBPawait client.products.search({ query: "raincoat" });// Override per-call (returns DE / EUR offers regardless of the client default)await client.products.search({ query: "raincoat", config: { country: "DE", currency: "EUR" },});
You can also set defaults via environment variables: CHANNEL3_LANGUAGE, CHANNEL3_COUNTRY, CHANNEL3_CURRENCY. The same pattern applies to dimension units — set lengthUnit / weightUnit on the client (or CHANNEL3_LENGTH_UNIT / CHANNEL3_WEIGHT_UNIT) to choose the units dimensions come back in. See Dimension units.
When only country is set, the server infers currency (e.g. GB → GBP) and language (e.g. GB → en). When all three are unset, defaults to en / US / USD.