The socNetAccount module stores per-user credential and identity rows for social-network client modules, currently Telegram, Twitter/X, and Bluesky/ATProto.
- Social account rows with network name, remote account ID, username/phone/full name, app credentials, access tokens, and session keys.
- Owner-scoped create/update and account lookup by local id or provider identity.
- Bounded account listing by network.
- Server statistics reads via
getStatistics(userId, input): owner/identity lookup, app-pass credential decryption and fixed-provider adapters instatistics.ts. Returns only metrics or unsupported, never secrets. - Test/support database flush helpers.
- All lookups are user-scoped.
- Create/update must not fall back to
{userId}alone; provider identity such as(socNet, accountId),(socNet, username), or(socNet, phoneNumber)is required unless a local id is supplied. - Encrypted credential/session values are passed through from client modules; this module stores them but does not know every provider's encryption semantics.
- Module API responses must sanitize secret credential/session fields such as API keys, access tokens, and session keys, exposing only safe
has*flags when needed. - Feature modules must avoid returning secret material to unauthorized callers.
- Credentialed cross-post/import flows must prove account ownership before use.
- Protocol-specific login/fetch logic belongs to client modules such as
telegramClientandtwitterClient. - Bluesky import/login and ownership verification belong to
bluesky. The dedicated server-statistics read adapter also lives here; historical storage and API orchestration belong tosocNetStatistics. - Source/import post identity belongs to
socNetImport, not account rows. - Do not use this module for generic external identity proofs; use
foreignAccountsfor that.
- Social Network Import module overview
- Bluesky module overview
- Telegram Client module overview
- Twitter Client module overview
Server Discord statistics now include approximate guild members/presence through the existing owned bot account, with typed access-denied/rate-limit outcomes. Channel membership and guild audience are not interchangeable. Shared audience history is owned by socNetStatistics.
Telegram user readers expose only safe id/label/ready metadata. getStatistics delegates historical Telegram message reads to telegramClient using the selected owned usable user account; bot publication credentials remain separate.