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

Method __init__

client/packages/python/src/instantdb/_async/http.py:26–49  ·  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.AsyncBaseTransport | None = None,
        shared_client: httpx.AsyncClient | None = None,
    )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected