Technical reference guide for built-in GitHub and Notion connectors in MemoFS.
@memofs/connectors ships with native, zero-dependency connectors for GitHub and Notion. Both connectors are registered by default in ConnectorRegistry and createConnectorRegistry().
Both built-in connectors follow an atomic pass lifecycle:
The connector fetches and paginates through its remote API, buffering all normalized ConnectorRecord objects in memory.
If an error occurs during pagination (e.g. rate limit, invalid credentials, network failure, or timeout), the connector throws immediately.
The runner catches the error, records it in RunConnectorsResult.errors, and moves to the next connector without writing any partial records from the failed pass.
If all pages succeed, the runner deduplicates records and commits new notes to .memofs/memory/notes.md.
This all-or-nothing pass behavior combined with the Connector-Write Discipline ensures that retrying an aborted sync is completely safe: unchanged items are never double-written, and failed batches leave no orphaned or half-written memory files.
GitHub Discussions do not have state or labels properties in the GraphQL API. Instead, discussion category names are extracted and mapped to metadata.labels = [category.name]. If discussions are disabled for the target repository, GitHub returns a field warning which the connector treats as empty rather than failing the run.
Rate Limits (HTTP 403 / 429): Throws GitHubRateLimitError. If the response contains an x-ratelimit-reset header, the UNIX epoch is extracted into error.resetEpoch.
Authentication Failure (HTTP 401): Throws an error indicating the token is missing or invalid. Tokens are never included in error messages.
GraphQL Errors: Fatal GraphQL errors are aggregated and thrown as a joined error message.
The NotionConnector ingests pages from a Notion database query or workspace-wide search via the Notion v1 REST API.
Class:NotionConnector
Type Identifier:"notion"
Endpoints:
Database Query: POST https://api.notion.com/v1/databases/:id/query
Workspace Search: POST https://api.notion.com/v1/search
Authentication: Notion Internal Integration Secret (secret_... or ntn_...) in Authorization: Bearer <token>. The target database or page must be explicitly shared with the integration.
Request Headers:
Authorization: Bearer <token>
Notion-Version: 2022-06-28
Content-Type: application/json
Request Timeout: 30,000 ms (REQUEST_TIMEOUT_MS) per page request.
Page Size: 25 items per request (PAGE_SIZE), paginated via start_cursor.
Rate Limits (HTTP 429): Throws NotionRateLimitError. If a retry-after header is returned, the delay in seconds is parsed into error.retryAfterSeconds.
Authorization & Permissions (HTTP 401 / 403): Throws NotionAuthError ("Notion authorization failed (401/403)..."). This distinct error indicates the integration token is invalid or the target database/page was never shared with the integration.
Request Failures: General HTTP failures throw descriptive errors without echoing the response body to prevent credential leaks.