MCPcopy Create free account
hub / github.com/instantdb/instant / __init__

Method __init__

client/packages/python/src/instantdb/_sync/http.py:28–51  ·  view source on GitHub ↗
(
        self,
        *,
        app_id: str,
        admin_token: str | None,
        api_uri: str = DEFAULT_API_URI,
        impersonation: dict[str, str] | None = None,
        transport: httpx.BaseTransport | None = None,
        shared_client: httpx.Client | None = None,
    )

Source from the content-addressed store, hash-verified

26
27class _HTTP:
28 def __init__(
29 self,
30 *,
31 app_id: str,
32 admin_token: str | None,
33 api_uri: str = DEFAULT_API_URI,
34 impersonation: dict[str, str] | None = None,
35 transport: httpx.BaseTransport | None = None,
36 shared_client: httpx.Client | None = None,
37 ) -> None:
38 self._app_id = app_id
39 self._admin_token = admin_token
40 self._api_uri = api_uri.rstrip("/")
41 self._impersonation = impersonation or {}
42 if shared_client is not None:
43 self._client = shared_client
44 self._owns_client = False
45 else:
46 self._client = httpx.Client(
47 base_url=self._api_uri,
48 timeout=DEFAULT_TIMEOUT,
49 transport=transport,
50 )
51 self._owns_client = True
52
53 def _headers(
54 self, *, unauthenticated: bool = False, admin_only: bool = False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected