Set API key as session header on MagicPlanClient construction 🟩

This commit is contained in:
Daniel Roth 2026-05-12 13:59:33 +00:00
parent da4f5f44c0
commit d59bf2d7cb

View file

@ -9,7 +9,7 @@ class MagicPlanClient:
def __init__(self, customer_id: str, api_key: str) -> None:
self._api_key = api_key
self._session = requests.Session()
self._session.headers.update({"customer": customer_id})
self._session.headers.update({"customer": customer_id, "key": api_key})
def get_plans(self) -> PlansListResponse:
r = self._session.get(f"{_BASE_URL}/plans", params={"key": self._api_key})