Skip to main content
Connect external platforms to automatically sync documents into supermemory. Supported connectors include Google Drive, Gmail, Notion, OneDrive, GitHub and Web Crawler with real-time synchronization and intelligent content processing.

Supported Connectors

Google Drive

Google Docs, Slides, SheetsReal-time sync via webhooks. Supports shared drives, nested folders, and collaborative documents.

Gmail

Email ThreadsReal-time sync via Pub/Sub webhooks. Syncs threads with full conversation history and metadata.

Notion

Pages, Databases, BlocksInstant sync of workspace content. Handles rich formatting, embeds, and database properties.

OneDrive

Word, Excel, PowerPointScheduled sync every 4 hours. Supports personal and business accounts with file versioning.

GitHub

GitHub RepositoriesReal-time incremental sync via webhooks. Supports documentation files in repositories.

Web Crawler

Web Pages, DocumentationCrawl websites automatically with robots.txt compliance. Scheduled recrawling keeps content up to date.

Quick Start

1. Create Connection

import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env.SUPERMEMORY_API_KEY!
});

const connection = await client.connections.create('notion', {
  redirectUrl: 'https://yourapp.com/callback',
  containerTags: ['user-123', 'workspace-alpha'],
  documentLimit: 5000,
  metadata: { department: 'sales' }
});

// Redirect user to complete OAuth
console.log('Auth URL:', connection.authLink);
console.log('Expires in:', connection.expiresIn);
// Output: Auth URL: https://api.notion.com/v1/oauth/authorize?...
// Output: Expires in: 1 hour

2. Handle OAuth Callback

After user completes OAuth, the connection is automatically established and sync begins.

3. Monitor Sync Status

import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env.SUPERMEMORY_API_KEY!
});

// List all connections using SDK
const connections = await client.connections.list({
  containerTags: ['user-123', 'workspace-alpha']
});

connections.forEach(conn => {
  console.log('Connection:', conn.id);
  console.log('Provider:', conn.provider);
  console.log('Email:', conn.email);
  console.log('Created:', conn.createdAt);
});

// List synced documents (memories) using SDK
const memories = await client.documents.list({
  containerTags: ['user-123', 'workspace-alpha']
});

console.log(`Synced ${memories.memories.length} documents`);
// Output: Synced 45 documents

How Connectors Work

Authentication Flow

  1. Create Connection: Call /v3/connections/{provider} to get OAuth URL (or direct connection for web-crawler)
  2. User Authorization: Redirect user to complete OAuth flow (not required for web-crawler)
  3. Automatic Setup: Connection established, sync begins immediately
  4. Continuous Sync: Real-time updates via webhooks + scheduled sync every 4 hours (or scheduled recrawling for web-crawler)

Document Processing Pipeline

Sync Mechanisms

ProviderReal-time SyncScheduled SyncManual Sync
Google Drive✅ Webhooks (7-day expiry)✅ Every 4 hours✅ On-demand
Gmail✅ Pub/Sub (7-day expiry)✅ Every 4 hours✅ On-demand
Notion✅ Webhooks✅ Every 4 hours✅ On-demand
OneDrive✅ Webhooks (30-day expiry)✅ Every 4 hours✅ On-demand
GitHub✅ Webhooks✅ Every 4 hours✅ On-demand
Web Crawler❌ Not supported✅ Scheduled recrawling (7+ days)✅ On-demand

Connection Management

List All Connections

import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env.SUPERMEMORY_API_KEY!
});

const connections = await client.connections.list({
  containerTags: ['org-123']
});

Delete Connections

The DELETE /v3/connections/:connectionId endpoint accepts an optional deleteDocuments query parameter:
ParameterTypeDefaultDescription
deleteDocumentsbooleantrueWhen true, all documents imported by the connection are permanently deleted. When false, the connection is removed but documents are kept.
Setting deleteDocuments=false is useful when you want to disconnect an integration without losing the memories that were already imported.
import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env.SUPERMEMORY_API_KEY!
});

// Delete connection and all imported documents (default)
const result = await client.connections.deleteByID(connectionId);

// Delete connection but keep imported documents
const result = await client.connections.deleteByID(connectionId, {
  deleteDocuments: false
});

// Or delete by provider (requires container tags)
const result = await client.connections.deleteByProvider('notion', {
  containerTags: ['user-123']
});

console.log('Deleted:', result.id, result.provider);