Skip to content
Get started

Create connection

client.connections.create("notion" | "google-drive" | "onedrive" | 4 moreprovider, ConnectionCreateParams { containerTag, containerTags, documentLimit, 2 more } body, RequestOptionsoptions?): ConnectionCreateResponse { id, authLink, expiresIn, redirectsTo }
POST/v3/connections/{provider}

Initialize connection and get authorization URL

ParametersExpand Collapse
provider: "notion" | "google-drive" | "onedrive" | 4 more
One of the following:
"notion"
"google-drive"
"onedrive"
"gmail"
"github"
"web-crawler"
"s3"
body: ConnectionCreateParams { containerTag, containerTags, documentLimit, 2 more }
containerTag?: string
maxLength100
containerTags?: Array<string>
documentLimit?: number
minimum1
maximum10000
metadata?: Record<string, string | number | boolean> | null
One of the following:
string
number
boolean
redirectUrl?: string
ReturnsExpand Collapse
ConnectionCreateResponse { id, authLink, expiresIn, redirectsTo }
id: string
expiresIn: string
redirectsTo?: string

Create connection

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.log(connection.id);
{
  "id": "id",
  "authLink": "authLink",
  "expiresIn": "expiresIn",
  "redirectsTo": "redirectsTo"
}
Returns Examples
{
  "id": "id",
  "authLink": "authLink",
  "expiresIn": "expiresIn",
  "redirectsTo": "redirectsTo"
}