diff options
| author | Dhravya Shah <[email protected]> | 2025-09-13 22:09:40 -0700 |
|---|---|---|
| committer | Dhravya Shah <[email protected]> | 2025-09-13 22:09:40 -0700 |
| commit | 90fd19f2156e28845d9288ea8ffc2d7d9573b77a (patch) | |
| tree | e630e3943d70b688c42a762c11c745159e1d6771 /apps/docs/memory-api/connectors | |
| parent | Merge branch 'main' of https://github.com/supermemoryai/supermemory (diff) | |
| download | supermemory-90fd19f2156e28845d9288ea8ffc2d7d9573b77a.tar.xz supermemory-90fd19f2156e28845d9288ea8ffc2d7d9573b77a.zip | |
update: Readme
Diffstat (limited to 'apps/docs/memory-api/connectors')
4 files changed, 0 insertions, 276 deletions
diff --git a/apps/docs/memory-api/connectors/advanced/bring-your-own-key.mdx b/apps/docs/memory-api/connectors/advanced/bring-your-own-key.mdx deleted file mode 100644 index 3d63cb46..00000000 --- a/apps/docs/memory-api/connectors/advanced/bring-your-own-key.mdx +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: 'Bring Your Own Key (BYOK)' -description: 'Configure your own OAuth application credentials for enhanced security and control' ---- - -By default, supermemory uses its own OAuth applications to connect to third-party providers. However, you can configure your own OAuth application credentials for enhanced security and control. This is particularly useful for enterprise customers who want to maintain control over their data access. - -<Danger> - Some providers like Google Drive require extensive verification and approval before you can use custom keys. -</Danger> - -### Setting up Custom Provider Keys - -To configure custom OAuth credentials for your organization, use the `PATCH /v3/settings` endpoint: - -1. Set up your OAuth application on the provider's developer console. - -Google: https://console.developers.google.com/apis/credentials/oauthclient \ -Notion: https://www.notion.so/my-integrations \ -OneDrive: https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsMenu - -2. If using Google drive, - -- Select the application type as `Web application` -- **Enable the Google drive api in "APIs and Services" in the Cloud Console** - -3. Configure the redirect URL, set it to: - -``` -https://api.supermemory.ai/v3/connections/auth/callback/{provider} -``` - -For example, if you are using Google Drive, the redirect URL would be: - -``` -https://api.supermemory.ai/v3/connections/auth/callback/google-drive -``` - -4. Configure the client ID and client secret in the `PATCH /v3/settings` endpoint. - -<CodeGroup> -```typescript Typescript -import Supermemory from 'supermemory'; - -const client = new Supermemory({ - apiKey: process.env['SUPERMEMORY_API_KEY'], -}); - -// Example: Configure Google Drive custom OAuth credentials -const settings = await client.settings.update({ - googleCustomKeyEnabled: true, - googleDriveClientId: "your-google-client-id", - googleDriveClientSecret: "your-google-client-secret" -}); - -// Example: Configure Notion custom OAuth credentials -const settings = await client.settings.update({ - notionCustomKeyEnabled: true, - notionClientId: "your-notion-client-id", - notionClientSecret: "your-notion-client-secret" -}); - -// Example: Configure OneDrive custom OAuth credentials -const settings = await client.settings.update({ - onedriveCustomKeyEnabled: true, - onedriveClientId: "your-onedrive-client-id", - onedriveClientSecret: "your-onedrive-client-secret" -}); -``` - -```python Python -from supermemory import supermemory - -client = supermemory( - api_key=os.environ.get("SUPERMEMORY_API_KEY"), # This is the default and can be omitted -) - -# Example: Configure Google Drive custom OAuth credentials -settings = client.settings.update( - google_custom_key_enabled=True, - google_client_id="your-google-client-id", - google_client_secret="your-google-client-secret" -) - -# Example: Configure Notion custom OAuth credentials -settings = client.settings.update( - notion_custom_key_enabled=True, - notion_client_id="your-notion-client-id", - notion_client_secret="your-notion-client-secret" -) - -# Example: Configure OneDrive custom OAuth credentials -settings = client.settings.update( - onedrive_custom_key_enabled=True, - onedrive_client_id="your-onedrive-client-id", - onedrive_client_secret="your-onedrive-client-secret" -) -``` - -```bash cURL -# Example: Configure Google Drive custom OAuth credentials -curl --request PATCH \ - --url https://api.supermemory.ai/v3/settings \ - --header 'Authorization: Bearer <token>' \ - --header 'Content-Type: application/json' \ - --data '{ - "googleDriveCustomKeyEnabled": true, - "googleDriveClientId": "your-google-client-id", - "googleDriveClientSecret": "your-google-client-secret" -}' - -# Example: Configure Notion custom OAuth credentials -curl --request PATCH \ - --url https://api.supermemory.ai/v3/settings \ - --header 'Authorization: Bearer <token>' \ - --header 'Content-Type: application/json' \ - --data '{ - "notionCustomKeyEnabled": true, - "notionClientId": "your-notion-client-id", - "notionClientSecret": "your-notion-client-secret" -}' - -# Example: Configure OneDrive custom OAuth credentials -curl --request PATCH \ - --url https://api.supermemory.ai/v3/settings \ - --header 'Authorization: Bearer <token>' \ - --header 'Content-Type: application/json' \ - --data '{ - "onedriveCustomKeyEnabled": true, - "onedriveClientId": "your-onedrive-client-id", - "onedriveClientSecret": "your-onedrive-client-secret" -}' -``` -</CodeGroup> - -<Warning> - Once you enable custom keys for a provider, all new connections for that provider will use your custom OAuth application. Existing connections WILL need to be re-authorized. -</Warning>
\ No newline at end of file diff --git a/apps/docs/memory-api/connectors/creating-connection.mdx b/apps/docs/memory-api/connectors/creating-connection.mdx deleted file mode 100644 index 39abc47a..00000000 --- a/apps/docs/memory-api/connectors/creating-connection.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: 'Creating connections' -description: 'Create a connection to sync your content with supermemory' ---- - -To create a connection, just make a `POST` request to `/v3/connections/{provider}` - -<CodeGroup> -```typescript Typescript -import Supermemory from 'supermemory'; - -const client = new Supermemory({ - apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted -}); - -const connection = await client.connections.create('notion'); - -console.debug(connection.authLink); -``` - -```python Python -import requests - -url = "https://api.supermemory.ai/v3/connections/{provider}" - -payload = { - "redirectUrl": "<string>", - "containerTags": ["<string>"], - "metadata": {}, - "documentLimit": 5000 -} -headers = { - "Authorization": "Bearer <token>", - "Content-Type": "application/json" -} - -response = requests.request("POST", url, json=payload, headers=headers) - -print(response.text) -``` - -```bash cURL -curl --request POST \ - --url https://api.supermemory.ai/v3/connections/{provider} \ - --header 'Authorization: Bearer <token>' \ - --header 'Content-Type: application/json' \ - --data '{ - "redirectUrl": "<string>", - "containerTags": [ - "<string>" - ], - "metadata": {}, - "documentLimit": 5000 -}' -``` -</CodeGroup> - -### Parameters - -- `provider`: The provider to connect to. Currently supported providers are `notion`, `google-drive`, `one-drive` -- `redirectUrl`: The URL to redirect to after the connection is created (your app URL) -- `containerTags`: Optional. For partitioning users, organizations, etc. in your app. - - Example: `["user_123", "project_alpha"]` -- `metadata`: Optional. Any metadata you want to associate with the connection. - - This metadata is added to every document synced from this connection. -- `documentLimit`: Optional. The maximum number of documents to sync from this connection. - - Default: 10,000 - - This can be used to limit costs and sync a set number of documents for a specific user. - - -## Response - -supermemory sends a response with the following schema: -```json -{ - "id": "<string>", - "authLink": "<string>", - "expiresIn": "<string>", - "redirectsTo": "<string>" -} -``` - -You can use the `authLink` to redirect the user to the provider's login page. - -Next up, managing connections. diff --git a/apps/docs/memory-api/connectors/google-drive.mdx b/apps/docs/memory-api/connectors/google-drive.mdx deleted file mode 100644 index 8413fdd2..00000000 --- a/apps/docs/memory-api/connectors/google-drive.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: 'Google Drive' -description: 'Sync your Google Drive content with supermemory' ---- - -supermemory syncs Google Drive documents automatically and instantaneously. - -## Supported file types - -- Google Docs -- Google Slides -- Google Sheets - -## Conversions - -To import items, supermemory converts documents into markdown, and then ingests them into supermemory. -This conversion is lossy, and some formatting may be lost. - -## Sync frequency - -supermemory syncs documents: -- **A document is modified or created (Webhook recieved)** - - Note that not all providers are synced via webhook (Instant sync right now) - - `Google-Drive` and `Notion` documents are synced instantaneously -- Every **four hours** -- On **Manual Sync** (API call) - - You can call `/v3/connections/{provider}/sync` to sync documents manually diff --git a/apps/docs/memory-api/connectors/overview.mdx b/apps/docs/memory-api/connectors/overview.mdx deleted file mode 100644 index 8727b68c..00000000 --- a/apps/docs/memory-api/connectors/overview.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: 'Connectors Overview' -sidebarTitle: 'Overview' -description: 'Sync external connections like Google Drive, Notion, OneDrive with supermemory' ---- - -supermemory can sync external connections like Google Drive, Notion, OneDrive with more coming soon. - -### The Flow - -1. Make a `POST` request to `/v3/connections/{provider}` -2. supermemory will return an `authLink` which you can redirect the user to -3. The user will be redirected to the provider's login page -4. User is redirected back to your app's `redirectUrl` - - - -## Sync frequency - -supermemory syncs documents: -- **A document is modified or created (Webhook recieved)** - - Note that not all providers are synced via webhook (Instant sync right now) - - `Google-Drive` and `Notion` documents are synced instantaneously -- Every **four hours** -- On **Manual Sync** (API call) - - You can call `/v3/connections/{provider}/sync` to sync documents manually |