integrate-sdk 0.7.65 → 0.7.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1625,7 +1625,7 @@ class OAuthManager {
1625
1625
  }
1626
1626
  clearProviderToken(provider) {
1627
1627
  this.providerTokens.delete(provider);
1628
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1628
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1629
1629
  try {
1630
1630
  window.localStorage.removeItem(`integrate_token_${provider}`);
1631
1631
  } catch (error) {
@@ -1636,7 +1636,7 @@ class OAuthManager {
1636
1636
  clearAllProviderTokens() {
1637
1637
  const providers = Array.from(this.providerTokens.keys());
1638
1638
  this.providerTokens.clear();
1639
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1639
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1640
1640
  for (const provider of providers) {
1641
1641
  try {
1642
1642
  window.localStorage.removeItem(`integrate_token_${provider}`);
@@ -2343,6 +2343,21 @@ class MCPClientBase {
2343
2343
  this.eventEmitter.emit("auth:error", { provider, error });
2344
2344
  throw error;
2345
2345
  }
2346
+ if (options?.useExistingConnection) {
2347
+ const authStatus = await this.oauthManager.checkAuthStatus(provider);
2348
+ if (authStatus.authorized) {
2349
+ const tokenData = await this.oauthManager.getProviderToken(provider);
2350
+ if (tokenData) {
2351
+ this.eventEmitter.emit("auth:complete", {
2352
+ provider,
2353
+ accessToken: tokenData.accessToken,
2354
+ expiresAt: tokenData.expiresAt
2355
+ });
2356
+ this.authState.set(provider, { authenticated: true });
2357
+ }
2358
+ return;
2359
+ }
2360
+ }
2346
2361
  this.eventEmitter.emit("auth:started", { provider });
2347
2362
  try {
2348
2363
  await this.oauthManager.initiateFlow(provider, integration.oauth, options?.returnUrl);
@@ -1484,7 +1484,7 @@ class OAuthManager {
1484
1484
  }
1485
1485
  clearProviderToken(provider) {
1486
1486
  this.providerTokens.delete(provider);
1487
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1487
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1488
1488
  try {
1489
1489
  window.localStorage.removeItem(`integrate_token_${provider}`);
1490
1490
  } catch (error) {
@@ -1495,7 +1495,7 @@ class OAuthManager {
1495
1495
  clearAllProviderTokens() {
1496
1496
  const providers = Array.from(this.providerTokens.keys());
1497
1497
  this.providerTokens.clear();
1498
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1498
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1499
1499
  for (const provider of providers) {
1500
1500
  try {
1501
1501
  window.localStorage.removeItem(`integrate_token_${provider}`);
@@ -2202,6 +2202,21 @@ class MCPClientBase {
2202
2202
  this.eventEmitter.emit("auth:error", { provider, error });
2203
2203
  throw error;
2204
2204
  }
2205
+ if (options?.useExistingConnection) {
2206
+ const authStatus = await this.oauthManager.checkAuthStatus(provider);
2207
+ if (authStatus.authorized) {
2208
+ const tokenData = await this.oauthManager.getProviderToken(provider);
2209
+ if (tokenData) {
2210
+ this.eventEmitter.emit("auth:complete", {
2211
+ provider,
2212
+ accessToken: tokenData.accessToken,
2213
+ expiresAt: tokenData.expiresAt
2214
+ });
2215
+ this.authState.set(provider, { authenticated: true });
2216
+ }
2217
+ return;
2218
+ }
2219
+ }
2205
2220
  this.eventEmitter.emit("auth:started", { provider });
2206
2221
  try {
2207
2222
  await this.oauthManager.initiateFlow(provider, integration.oauth, options?.returnUrl);
@@ -1484,7 +1484,7 @@ class OAuthManager {
1484
1484
  }
1485
1485
  clearProviderToken(provider) {
1486
1486
  this.providerTokens.delete(provider);
1487
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1487
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1488
1488
  try {
1489
1489
  window.localStorage.removeItem(`integrate_token_${provider}`);
1490
1490
  } catch (error) {
@@ -1495,7 +1495,7 @@ class OAuthManager {
1495
1495
  clearAllProviderTokens() {
1496
1496
  const providers = Array.from(this.providerTokens.keys());
1497
1497
  this.providerTokens.clear();
1498
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1498
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1499
1499
  for (const provider of providers) {
1500
1500
  try {
1501
1501
  window.localStorage.removeItem(`integrate_token_${provider}`);
@@ -2202,6 +2202,21 @@ class MCPClientBase {
2202
2202
  this.eventEmitter.emit("auth:error", { provider, error });
2203
2203
  throw error;
2204
2204
  }
2205
+ if (options?.useExistingConnection) {
2206
+ const authStatus = await this.oauthManager.checkAuthStatus(provider);
2207
+ if (authStatus.authorized) {
2208
+ const tokenData = await this.oauthManager.getProviderToken(provider);
2209
+ if (tokenData) {
2210
+ this.eventEmitter.emit("auth:complete", {
2211
+ provider,
2212
+ accessToken: tokenData.accessToken,
2213
+ expiresAt: tokenData.expiresAt
2214
+ });
2215
+ this.authState.set(provider, { authenticated: true });
2216
+ }
2217
+ return;
2218
+ }
2219
+ }
2205
2220
  this.eventEmitter.emit("auth:started", { provider });
2206
2221
  try {
2207
2222
  await this.oauthManager.initiateFlow(provider, integration.oauth, options?.returnUrl);
package/dist/index.d.ts CHANGED
@@ -37,8 +37,9 @@ export * from './src/index.js';
37
37
  * Default configuration:
38
38
  * - Calls API routes at: {window.location.origin}/api/integrate/mcp
39
39
  * - OAuth routes at: {window.location.origin}/api/integrate/oauth/*
40
+ * - Does NOT save tokens to localStorage (tokens are managed server-side)
40
41
  *
41
- * For custom configuration (different apiBaseUrl, apiRouteBase, etc.),
42
+ * For custom configuration (different apiBaseUrl, apiRouteBase, localStorage, etc.),
42
43
  * use `createMCPClient()` instead.
43
44
  *
44
45
  * @example
@@ -51,6 +52,17 @@ export * from './src/index.js';
51
52
  * // Use Gmail integration
52
53
  * const messages = await client.gmail.listMessages({});
53
54
  * ```
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * // If you need localStorage or custom config, create your own client:
59
+ * import { createMCPClient, githubIntegration } from 'integrate-sdk';
60
+ *
61
+ * const customClient = createMCPClient({
62
+ * integrations: [githubIntegration()],
63
+ * skipLocalStorage: false, // Enable localStorage if needed
64
+ * });
65
+ * ```
54
66
  */
55
67
  export declare const client: import("./index.js").MCPClient<(import("./index.js").MCPIntegration<"github"> | import("./index.js").MCPIntegration<"gmail"> | import("./index.js").MCPIntegration<"notion">)[]>;
56
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,cAAc,gBAAgB,CAAC;AAQ/B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,MAAM,kLAMjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,cAAc,gBAAgB,CAAC;AAQ/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,MAAM,kLASjB,CAAC"}
package/dist/index.js CHANGED
@@ -1325,7 +1325,7 @@ class OAuthManager {
1325
1325
  }
1326
1326
  clearProviderToken(provider) {
1327
1327
  this.providerTokens.delete(provider);
1328
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1328
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1329
1329
  try {
1330
1330
  window.localStorage.removeItem(`integrate_token_${provider}`);
1331
1331
  } catch (error) {
@@ -1336,7 +1336,7 @@ class OAuthManager {
1336
1336
  clearAllProviderTokens() {
1337
1337
  const providers = Array.from(this.providerTokens.keys());
1338
1338
  this.providerTokens.clear();
1339
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1339
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1340
1340
  for (const provider of providers) {
1341
1341
  try {
1342
1342
  window.localStorage.removeItem(`integrate_token_${provider}`);
@@ -2045,6 +2045,21 @@ class MCPClientBase {
2045
2045
  this.eventEmitter.emit("auth:error", { provider, error });
2046
2046
  throw error;
2047
2047
  }
2048
+ if (options?.useExistingConnection) {
2049
+ const authStatus = await this.oauthManager.checkAuthStatus(provider);
2050
+ if (authStatus.authorized) {
2051
+ const tokenData = await this.oauthManager.getProviderToken(provider);
2052
+ if (tokenData) {
2053
+ this.eventEmitter.emit("auth:complete", {
2054
+ provider,
2055
+ accessToken: tokenData.accessToken,
2056
+ expiresAt: tokenData.expiresAt
2057
+ });
2058
+ this.authState.set(provider, { authenticated: true });
2059
+ }
2060
+ return;
2061
+ }
2062
+ }
2048
2063
  this.eventEmitter.emit("auth:started", { provider });
2049
2064
  try {
2050
2065
  await this.oauthManager.initiateFlow(provider, integration.oauth, options?.returnUrl);
@@ -2935,7 +2950,8 @@ var client = createMCPClient({
2935
2950
  githubIntegration(),
2936
2951
  gmailIntegration(),
2937
2952
  notionIntegration()
2938
- ]
2953
+ ],
2954
+ skipLocalStorage: true
2939
2955
  });
2940
2956
  export {
2941
2957
  toTanStackStartHandler,
package/dist/server.js CHANGED
@@ -1318,7 +1318,7 @@ class OAuthManager {
1318
1318
  }
1319
1319
  clearProviderToken(provider) {
1320
1320
  this.providerTokens.delete(provider);
1321
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1321
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1322
1322
  try {
1323
1323
  window.localStorage.removeItem(`integrate_token_${provider}`);
1324
1324
  } catch (error) {
@@ -1329,7 +1329,7 @@ class OAuthManager {
1329
1329
  clearAllProviderTokens() {
1330
1330
  const providers = Array.from(this.providerTokens.keys());
1331
1331
  this.providerTokens.clear();
1332
- if (!this.getTokenCallback && typeof window !== "undefined" && window.localStorage) {
1332
+ if (!this.skipLocalStorage && typeof window !== "undefined" && window.localStorage) {
1333
1333
  for (const provider of providers) {
1334
1334
  try {
1335
1335
  window.localStorage.removeItem(`integrate_token_${provider}`);
@@ -2036,6 +2036,21 @@ class MCPClientBase {
2036
2036
  this.eventEmitter.emit("auth:error", { provider, error });
2037
2037
  throw error;
2038
2038
  }
2039
+ if (options?.useExistingConnection) {
2040
+ const authStatus = await this.oauthManager.checkAuthStatus(provider);
2041
+ if (authStatus.authorized) {
2042
+ const tokenData = await this.oauthManager.getProviderToken(provider);
2043
+ if (tokenData) {
2044
+ this.eventEmitter.emit("auth:complete", {
2045
+ provider,
2046
+ accessToken: tokenData.accessToken,
2047
+ expiresAt: tokenData.expiresAt
2048
+ });
2049
+ this.authState.set(provider, { authenticated: true });
2050
+ }
2051
+ return;
2052
+ }
2053
+ }
2039
2054
  this.eventEmitter.emit("auth:started", { provider });
2040
2055
  try {
2041
2056
  await this.oauthManager.initiateFlow(provider, integration.oauth, options?.returnUrl);
@@ -322,6 +322,7 @@ export declare class MCPClientBase<TIntegrations extends readonly MCPIntegration
322
322
  * @param provider - Provider name (github, gmail, etc.)
323
323
  * @param options - Optional configuration for the authorization flow
324
324
  * @param options.returnUrl - URL to redirect to after OAuth completion (for redirect mode)
325
+ * @param options.useExistingConnection - If true and a connection exists, skip OAuth and use existing token. If false or undefined, proceed with OAuth flow (allows creating new account even if one exists)
325
326
  *
326
327
  * @example
327
328
  * ```typescript
@@ -337,10 +338,21 @@ export declare class MCPClientBase<TIntegrations extends readonly MCPIntegration
337
338
  * await client.authorize('github', {
338
339
  * returnUrl: window.location.pathname
339
340
  * });
341
+ *
342
+ * // Use existing connection if available
343
+ * await client.authorize('github', {
344
+ * useExistingConnection: true
345
+ * });
346
+ *
347
+ * // Force new connection (default behavior)
348
+ * await client.authorize('github', {
349
+ * useExistingConnection: false
350
+ * });
340
351
  * ```
341
352
  */
342
353
  authorize(provider: string, options?: {
343
354
  returnUrl?: string;
355
+ useExistingConnection?: boolean;
344
356
  }): Promise<void>;
345
357
  /**
346
358
  * Handle OAuth callback after user authorization
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,OAAO,EAEP,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAiB,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAgE1B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AACvE,KAAK,cAAc,CAAC,aAAa,SAAS,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnH;;;GAGG;AACH,KAAK,qBAAqB,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IAuBrE;;;;;;;OAOG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,kBAAkB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAIjI;;;;;;;OAOG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,kBAAkB,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtI;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAW9C;;;OAGG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA2BzD;AAmED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,aAAa,SAAS,SAAS,cAAc,EAAE,EAC7E,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,GACrC,SAAS,CAAC,aAAa,CAAC,CAmE1B;AAiFD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAetD"}
package/index.ts CHANGED
@@ -45,8 +45,9 @@ import { notionIntegration } from './src/integrations/notion.js';
45
45
  * Default configuration:
46
46
  * - Calls API routes at: {window.location.origin}/api/integrate/mcp
47
47
  * - OAuth routes at: {window.location.origin}/api/integrate/oauth/*
48
+ * - Does NOT save tokens to localStorage (tokens are managed server-side)
48
49
  *
49
- * For custom configuration (different apiBaseUrl, apiRouteBase, etc.),
50
+ * For custom configuration (different apiBaseUrl, apiRouteBase, localStorage, etc.),
50
51
  * use `createMCPClient()` instead.
51
52
  *
52
53
  * @example
@@ -59,6 +60,17 @@ import { notionIntegration } from './src/integrations/notion.js';
59
60
  * // Use Gmail integration
60
61
  * const messages = await client.gmail.listMessages({});
61
62
  * ```
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * // If you need localStorage or custom config, create your own client:
67
+ * import { createMCPClient, githubIntegration } from 'integrate-sdk';
68
+ *
69
+ * const customClient = createMCPClient({
70
+ * integrations: [githubIntegration()],
71
+ * skipLocalStorage: false, // Enable localStorage if needed
72
+ * });
73
+ * ```
62
74
  */
63
75
  export const client = createMCPClient({
64
76
  integrations: [
@@ -66,5 +78,8 @@ export const client = createMCPClient({
66
78
  gmailIntegration(),
67
79
  notionIntegration(),
68
80
  ],
81
+ // Default client doesn't use localStorage - tokens are managed server-side
82
+ // If you need localStorage, create your own client with createMCPClient()
83
+ skipLocalStorage: true,
69
84
  });
70
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integrate-sdk",
3
- "version": "0.7.65",
3
+ "version": "0.7.67",
4
4
  "description": "Type-safe 3rd party integration SDK for the Integrate MCP server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",