atproto_client.client.session¶

class atproto_client.client.session.Session(handle: str, did: str, access_jwt: str, refresh_jwt: str, pds_endpoint: str | None = 'https://bsky.social')¶

Bases: object

access_jwt: str¶
property access_jwt_payload: JwtPayload¶
copy() Session¶
classmethod decode(session_string: str) Session¶
did: str¶
encode() str¶
export() str¶

Alias for encode

handle: str¶
pds_endpoint: str | None = 'https://bsky.social'¶
refresh_jwt: str¶
property refresh_jwt_payload: JwtPayload¶
class atproto_client.client.session.SessionDispatcher(session: Session | None = None)¶

Bases: object

dispatch_session_change(event: SessionEvent) None¶
async dispatch_session_change_async(event: SessionEvent) None¶
on_session_change(callback: Callable[[SessionEvent, Session], Coroutine[Any, Any, None]] | Callable[[SessionEvent, Session], None]) None¶
set_session(session: Session) None¶
class atproto_client.client.session.SessionEvent(value)¶

Bases: Enum

An enumeration.

CREATE = 'create'¶
IMPORT = 'import'¶
REFRESH = 'refresh'¶
atproto_client.client.session.get_session_pds_endpoint(session: SessionResponse) str | None¶

Return the PDS endpoint of the given session.

Note

Return None for self-hosted PDSs.