integrate-sdk 0.7.57 → 0.7.60

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.
package/README.md CHANGED
@@ -246,7 +246,7 @@ The SDK implements OAuth 2.0 Authorization Code Flow with PKCE for secure author
246
246
 
247
247
  ```typescript
248
248
  // Check authorization
249
- if (!client.isAuthorized("github")) {
249
+ if (!(await client.isAuthorized("github"))) {
250
250
  await client.authorize("github"); // Opens popup or redirects
251
251
  }
252
252
 
@@ -1613,6 +1613,9 @@ class OAuthManager {
1613
1613
  getAllProviderTokens() {
1614
1614
  return new Map(this.providerTokens);
1615
1615
  }
1616
+ getProviderTokenFromCache(provider) {
1617
+ return this.providerTokens.get(provider);
1618
+ }
1616
1619
  async setProviderToken(provider, tokenData, context) {
1617
1620
  this.providerTokens.set(provider, tokenData);
1618
1621
  await this.saveProviderToken(provider, tokenData, context);
@@ -1707,6 +1710,34 @@ class OAuthManager {
1707
1710
  }
1708
1711
  }
1709
1712
  }
1713
+ loadProviderTokenSync(provider) {
1714
+ if (this.getTokenCallback) {
1715
+ return;
1716
+ }
1717
+ if (typeof window !== "undefined" && window.localStorage) {
1718
+ try {
1719
+ const key = `integrate_token_${provider}`;
1720
+ const stored = window.localStorage.getItem(key);
1721
+ if (stored) {
1722
+ return JSON.parse(stored);
1723
+ }
1724
+ } catch (error) {
1725
+ console.error(`Failed to load token for ${provider} from localStorage:`, error);
1726
+ }
1727
+ }
1728
+ return;
1729
+ }
1730
+ loadAllProviderTokensSync(providers) {
1731
+ if (this.getTokenCallback) {
1732
+ return;
1733
+ }
1734
+ for (const provider of providers) {
1735
+ const tokenData = this.loadProviderTokenSync(provider);
1736
+ if (tokenData) {
1737
+ this.providerTokens.set(provider, tokenData);
1738
+ }
1739
+ }
1740
+ }
1710
1741
  savePendingAuthToStorage(state, pendingAuth) {
1711
1742
  if (typeof window !== "undefined" && window.localStorage) {
1712
1743
  try {
@@ -1870,6 +1901,7 @@ class MCPClientBase {
1870
1901
  eventEmitter = new SimpleEventEmitter;
1871
1902
  apiRouteBase;
1872
1903
  apiBaseUrl;
1904
+ oauthCallbackPromise;
1873
1905
  server;
1874
1906
  constructor(config) {
1875
1907
  this.transport = new HttpSessionTransport({
@@ -1913,28 +1945,45 @@ class MCPClientBase {
1913
1945
  }
1914
1946
  }
1915
1947
  const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
1916
- this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1917
- for (const integration of this.integrations) {
1918
- if (integration.oauth) {
1919
- const provider = integration.oauth.provider;
1920
- try {
1921
- const tokenData = await this.oauthManager.getProviderToken(provider);
1922
- const currentState = this.authState.get(provider);
1923
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1924
- this.authState.set(provider, { authenticated: !!tokenData });
1948
+ const hasOAuthCallback = typeof window !== "undefined" && window.location && window.location.hash && window.location.hash.includes("oauth_callback=");
1949
+ const usingDatabaseCallbacks = !!config.getProviderToken;
1950
+ if (usingDatabaseCallbacks) {
1951
+ this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1952
+ for (const integration of this.integrations) {
1953
+ if (integration.oauth) {
1954
+ const provider = integration.oauth.provider;
1955
+ try {
1956
+ const tokenData = await this.oauthManager.getProviderToken(provider);
1957
+ const currentState = this.authState.get(provider);
1958
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1959
+ this.authState.set(provider, { authenticated: !!tokenData });
1960
+ }
1961
+ } catch (error) {
1962
+ console.error(`Failed to check token for ${provider}:`, error);
1963
+ const currentState = this.authState.get(provider);
1964
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1965
+ this.authState.set(provider, { authenticated: false });
1966
+ }
1925
1967
  }
1926
- } catch (error) {
1927
- console.error(`Failed to check token for ${provider}:`, error);
1928
- const currentState = this.authState.get(provider);
1929
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1930
- this.authState.set(provider, { authenticated: false });
1968
+ }
1969
+ }
1970
+ }).catch((error) => {
1971
+ console.error("Failed to load provider tokens:", error);
1972
+ });
1973
+ } else {
1974
+ if (!hasOAuthCallback) {
1975
+ this.oauthManager.loadAllProviderTokensSync(providers);
1976
+ for (const integration of this.integrations) {
1977
+ if (integration.oauth) {
1978
+ const provider = integration.oauth.provider;
1979
+ const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
1980
+ if (tokenData) {
1981
+ this.authState.set(provider, { authenticated: true });
1931
1982
  }
1932
1983
  }
1933
1984
  }
1934
- }
1935
- }).catch((error) => {
1936
- console.error("Failed to load provider tokens:", error);
1937
- });
1985
+ } else {}
1986
+ }
1938
1987
  const integrationIds = this.integrations.map((i) => i.id);
1939
1988
  if (integrationIds.includes("github")) {
1940
1989
  this.github = this.createIntegrationProxy("github");
@@ -2242,10 +2291,18 @@ class MCPClientBase {
2242
2291
  isProviderAuthenticated(provider) {
2243
2292
  return this.authState.get(provider)?.authenticated ?? false;
2244
2293
  }
2245
- isAuthorized(provider) {
2294
+ async isAuthorized(provider) {
2295
+ if (this.oauthCallbackPromise) {
2296
+ await this.oauthCallbackPromise;
2297
+ this.oauthCallbackPromise = null;
2298
+ }
2246
2299
  return this.authState.get(provider)?.authenticated ?? false;
2247
2300
  }
2248
- authorizedProviders() {
2301
+ async authorizedProviders() {
2302
+ if (this.oauthCallbackPromise) {
2303
+ await this.oauthCallbackPromise;
2304
+ this.oauthCallbackPromise = null;
2305
+ }
2249
2306
  const authorized = [];
2250
2307
  for (const integration of this.integrations) {
2251
2308
  if (integration.oauth) {
@@ -1472,6 +1472,9 @@ class OAuthManager {
1472
1472
  getAllProviderTokens() {
1473
1473
  return new Map(this.providerTokens);
1474
1474
  }
1475
+ getProviderTokenFromCache(provider) {
1476
+ return this.providerTokens.get(provider);
1477
+ }
1475
1478
  async setProviderToken(provider, tokenData, context) {
1476
1479
  this.providerTokens.set(provider, tokenData);
1477
1480
  await this.saveProviderToken(provider, tokenData, context);
@@ -1566,6 +1569,34 @@ class OAuthManager {
1566
1569
  }
1567
1570
  }
1568
1571
  }
1572
+ loadProviderTokenSync(provider) {
1573
+ if (this.getTokenCallback) {
1574
+ return;
1575
+ }
1576
+ if (typeof window !== "undefined" && window.localStorage) {
1577
+ try {
1578
+ const key = `integrate_token_${provider}`;
1579
+ const stored = window.localStorage.getItem(key);
1580
+ if (stored) {
1581
+ return JSON.parse(stored);
1582
+ }
1583
+ } catch (error) {
1584
+ console.error(`Failed to load token for ${provider} from localStorage:`, error);
1585
+ }
1586
+ }
1587
+ return;
1588
+ }
1589
+ loadAllProviderTokensSync(providers) {
1590
+ if (this.getTokenCallback) {
1591
+ return;
1592
+ }
1593
+ for (const provider of providers) {
1594
+ const tokenData = this.loadProviderTokenSync(provider);
1595
+ if (tokenData) {
1596
+ this.providerTokens.set(provider, tokenData);
1597
+ }
1598
+ }
1599
+ }
1569
1600
  savePendingAuthToStorage(state, pendingAuth) {
1570
1601
  if (typeof window !== "undefined" && window.localStorage) {
1571
1602
  try {
@@ -1729,6 +1760,7 @@ class MCPClientBase {
1729
1760
  eventEmitter = new SimpleEventEmitter;
1730
1761
  apiRouteBase;
1731
1762
  apiBaseUrl;
1763
+ oauthCallbackPromise;
1732
1764
  server;
1733
1765
  constructor(config) {
1734
1766
  this.transport = new HttpSessionTransport({
@@ -1772,28 +1804,45 @@ class MCPClientBase {
1772
1804
  }
1773
1805
  }
1774
1806
  const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
1775
- this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1776
- for (const integration of this.integrations) {
1777
- if (integration.oauth) {
1778
- const provider = integration.oauth.provider;
1779
- try {
1780
- const tokenData = await this.oauthManager.getProviderToken(provider);
1781
- const currentState = this.authState.get(provider);
1782
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1783
- this.authState.set(provider, { authenticated: !!tokenData });
1807
+ const hasOAuthCallback = typeof window !== "undefined" && window.location && window.location.hash && window.location.hash.includes("oauth_callback=");
1808
+ const usingDatabaseCallbacks = !!config.getProviderToken;
1809
+ if (usingDatabaseCallbacks) {
1810
+ this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1811
+ for (const integration of this.integrations) {
1812
+ if (integration.oauth) {
1813
+ const provider = integration.oauth.provider;
1814
+ try {
1815
+ const tokenData = await this.oauthManager.getProviderToken(provider);
1816
+ const currentState = this.authState.get(provider);
1817
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1818
+ this.authState.set(provider, { authenticated: !!tokenData });
1819
+ }
1820
+ } catch (error) {
1821
+ console.error(`Failed to check token for ${provider}:`, error);
1822
+ const currentState = this.authState.get(provider);
1823
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1824
+ this.authState.set(provider, { authenticated: false });
1825
+ }
1784
1826
  }
1785
- } catch (error) {
1786
- console.error(`Failed to check token for ${provider}:`, error);
1787
- const currentState = this.authState.get(provider);
1788
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1789
- this.authState.set(provider, { authenticated: false });
1827
+ }
1828
+ }
1829
+ }).catch((error) => {
1830
+ console.error("Failed to load provider tokens:", error);
1831
+ });
1832
+ } else {
1833
+ if (!hasOAuthCallback) {
1834
+ this.oauthManager.loadAllProviderTokensSync(providers);
1835
+ for (const integration of this.integrations) {
1836
+ if (integration.oauth) {
1837
+ const provider = integration.oauth.provider;
1838
+ const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
1839
+ if (tokenData) {
1840
+ this.authState.set(provider, { authenticated: true });
1790
1841
  }
1791
1842
  }
1792
1843
  }
1793
- }
1794
- }).catch((error) => {
1795
- console.error("Failed to load provider tokens:", error);
1796
- });
1844
+ } else {}
1845
+ }
1797
1846
  const integrationIds = this.integrations.map((i) => i.id);
1798
1847
  if (integrationIds.includes("github")) {
1799
1848
  this.github = this.createIntegrationProxy("github");
@@ -2101,10 +2150,18 @@ class MCPClientBase {
2101
2150
  isProviderAuthenticated(provider) {
2102
2151
  return this.authState.get(provider)?.authenticated ?? false;
2103
2152
  }
2104
- isAuthorized(provider) {
2153
+ async isAuthorized(provider) {
2154
+ if (this.oauthCallbackPromise) {
2155
+ await this.oauthCallbackPromise;
2156
+ this.oauthCallbackPromise = null;
2157
+ }
2105
2158
  return this.authState.get(provider)?.authenticated ?? false;
2106
2159
  }
2107
- authorizedProviders() {
2160
+ async authorizedProviders() {
2161
+ if (this.oauthCallbackPromise) {
2162
+ await this.oauthCallbackPromise;
2163
+ this.oauthCallbackPromise = null;
2164
+ }
2108
2165
  const authorized = [];
2109
2166
  for (const integration of this.integrations) {
2110
2167
  if (integration.oauth) {
@@ -1472,6 +1472,9 @@ class OAuthManager {
1472
1472
  getAllProviderTokens() {
1473
1473
  return new Map(this.providerTokens);
1474
1474
  }
1475
+ getProviderTokenFromCache(provider) {
1476
+ return this.providerTokens.get(provider);
1477
+ }
1475
1478
  async setProviderToken(provider, tokenData, context) {
1476
1479
  this.providerTokens.set(provider, tokenData);
1477
1480
  await this.saveProviderToken(provider, tokenData, context);
@@ -1566,6 +1569,34 @@ class OAuthManager {
1566
1569
  }
1567
1570
  }
1568
1571
  }
1572
+ loadProviderTokenSync(provider) {
1573
+ if (this.getTokenCallback) {
1574
+ return;
1575
+ }
1576
+ if (typeof window !== "undefined" && window.localStorage) {
1577
+ try {
1578
+ const key = `integrate_token_${provider}`;
1579
+ const stored = window.localStorage.getItem(key);
1580
+ if (stored) {
1581
+ return JSON.parse(stored);
1582
+ }
1583
+ } catch (error) {
1584
+ console.error(`Failed to load token for ${provider} from localStorage:`, error);
1585
+ }
1586
+ }
1587
+ return;
1588
+ }
1589
+ loadAllProviderTokensSync(providers) {
1590
+ if (this.getTokenCallback) {
1591
+ return;
1592
+ }
1593
+ for (const provider of providers) {
1594
+ const tokenData = this.loadProviderTokenSync(provider);
1595
+ if (tokenData) {
1596
+ this.providerTokens.set(provider, tokenData);
1597
+ }
1598
+ }
1599
+ }
1569
1600
  savePendingAuthToStorage(state, pendingAuth) {
1570
1601
  if (typeof window !== "undefined" && window.localStorage) {
1571
1602
  try {
@@ -1729,6 +1760,7 @@ class MCPClientBase {
1729
1760
  eventEmitter = new SimpleEventEmitter;
1730
1761
  apiRouteBase;
1731
1762
  apiBaseUrl;
1763
+ oauthCallbackPromise;
1732
1764
  server;
1733
1765
  constructor(config) {
1734
1766
  this.transport = new HttpSessionTransport({
@@ -1772,28 +1804,45 @@ class MCPClientBase {
1772
1804
  }
1773
1805
  }
1774
1806
  const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
1775
- this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1776
- for (const integration of this.integrations) {
1777
- if (integration.oauth) {
1778
- const provider = integration.oauth.provider;
1779
- try {
1780
- const tokenData = await this.oauthManager.getProviderToken(provider);
1781
- const currentState = this.authState.get(provider);
1782
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1783
- this.authState.set(provider, { authenticated: !!tokenData });
1807
+ const hasOAuthCallback = typeof window !== "undefined" && window.location && window.location.hash && window.location.hash.includes("oauth_callback=");
1808
+ const usingDatabaseCallbacks = !!config.getProviderToken;
1809
+ if (usingDatabaseCallbacks) {
1810
+ this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1811
+ for (const integration of this.integrations) {
1812
+ if (integration.oauth) {
1813
+ const provider = integration.oauth.provider;
1814
+ try {
1815
+ const tokenData = await this.oauthManager.getProviderToken(provider);
1816
+ const currentState = this.authState.get(provider);
1817
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1818
+ this.authState.set(provider, { authenticated: !!tokenData });
1819
+ }
1820
+ } catch (error) {
1821
+ console.error(`Failed to check token for ${provider}:`, error);
1822
+ const currentState = this.authState.get(provider);
1823
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1824
+ this.authState.set(provider, { authenticated: false });
1825
+ }
1784
1826
  }
1785
- } catch (error) {
1786
- console.error(`Failed to check token for ${provider}:`, error);
1787
- const currentState = this.authState.get(provider);
1788
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1789
- this.authState.set(provider, { authenticated: false });
1827
+ }
1828
+ }
1829
+ }).catch((error) => {
1830
+ console.error("Failed to load provider tokens:", error);
1831
+ });
1832
+ } else {
1833
+ if (!hasOAuthCallback) {
1834
+ this.oauthManager.loadAllProviderTokensSync(providers);
1835
+ for (const integration of this.integrations) {
1836
+ if (integration.oauth) {
1837
+ const provider = integration.oauth.provider;
1838
+ const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
1839
+ if (tokenData) {
1840
+ this.authState.set(provider, { authenticated: true });
1790
1841
  }
1791
1842
  }
1792
1843
  }
1793
- }
1794
- }).catch((error) => {
1795
- console.error("Failed to load provider tokens:", error);
1796
- });
1844
+ } else {}
1845
+ }
1797
1846
  const integrationIds = this.integrations.map((i) => i.id);
1798
1847
  if (integrationIds.includes("github")) {
1799
1848
  this.github = this.createIntegrationProxy("github");
@@ -2101,10 +2150,18 @@ class MCPClientBase {
2101
2150
  isProviderAuthenticated(provider) {
2102
2151
  return this.authState.get(provider)?.authenticated ?? false;
2103
2152
  }
2104
- isAuthorized(provider) {
2153
+ async isAuthorized(provider) {
2154
+ if (this.oauthCallbackPromise) {
2155
+ await this.oauthCallbackPromise;
2156
+ this.oauthCallbackPromise = null;
2157
+ }
2105
2158
  return this.authState.get(provider)?.authenticated ?? false;
2106
2159
  }
2107
- authorizedProviders() {
2160
+ async authorizedProviders() {
2161
+ if (this.oauthCallbackPromise) {
2162
+ await this.oauthCallbackPromise;
2163
+ this.oauthCallbackPromise = null;
2164
+ }
2108
2165
  const authorized = [];
2109
2166
  for (const integration of this.integrations) {
2110
2167
  if (integration.oauth) {
package/dist/index.js CHANGED
@@ -1313,6 +1313,9 @@ class OAuthManager {
1313
1313
  getAllProviderTokens() {
1314
1314
  return new Map(this.providerTokens);
1315
1315
  }
1316
+ getProviderTokenFromCache(provider) {
1317
+ return this.providerTokens.get(provider);
1318
+ }
1316
1319
  async setProviderToken(provider, tokenData, context) {
1317
1320
  this.providerTokens.set(provider, tokenData);
1318
1321
  await this.saveProviderToken(provider, tokenData, context);
@@ -1407,6 +1410,34 @@ class OAuthManager {
1407
1410
  }
1408
1411
  }
1409
1412
  }
1413
+ loadProviderTokenSync(provider) {
1414
+ if (this.getTokenCallback) {
1415
+ return;
1416
+ }
1417
+ if (typeof window !== "undefined" && window.localStorage) {
1418
+ try {
1419
+ const key = `integrate_token_${provider}`;
1420
+ const stored = window.localStorage.getItem(key);
1421
+ if (stored) {
1422
+ return JSON.parse(stored);
1423
+ }
1424
+ } catch (error) {
1425
+ console.error(`Failed to load token for ${provider} from localStorage:`, error);
1426
+ }
1427
+ }
1428
+ return;
1429
+ }
1430
+ loadAllProviderTokensSync(providers) {
1431
+ if (this.getTokenCallback) {
1432
+ return;
1433
+ }
1434
+ for (const provider of providers) {
1435
+ const tokenData = this.loadProviderTokenSync(provider);
1436
+ if (tokenData) {
1437
+ this.providerTokens.set(provider, tokenData);
1438
+ }
1439
+ }
1440
+ }
1410
1441
  savePendingAuthToStorage(state, pendingAuth) {
1411
1442
  if (typeof window !== "undefined" && window.localStorage) {
1412
1443
  try {
@@ -1572,6 +1603,7 @@ class MCPClientBase {
1572
1603
  eventEmitter = new SimpleEventEmitter;
1573
1604
  apiRouteBase;
1574
1605
  apiBaseUrl;
1606
+ oauthCallbackPromise;
1575
1607
  server;
1576
1608
  constructor(config) {
1577
1609
  this.transport = new HttpSessionTransport({
@@ -1615,28 +1647,45 @@ class MCPClientBase {
1615
1647
  }
1616
1648
  }
1617
1649
  const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
1618
- this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1619
- for (const integration of this.integrations) {
1620
- if (integration.oauth) {
1621
- const provider = integration.oauth.provider;
1622
- try {
1623
- const tokenData = await this.oauthManager.getProviderToken(provider);
1624
- const currentState = this.authState.get(provider);
1625
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1626
- this.authState.set(provider, { authenticated: !!tokenData });
1650
+ const hasOAuthCallback = typeof window !== "undefined" && window.location && window.location.hash && window.location.hash.includes("oauth_callback=");
1651
+ const usingDatabaseCallbacks = !!config.getProviderToken;
1652
+ if (usingDatabaseCallbacks) {
1653
+ this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1654
+ for (const integration of this.integrations) {
1655
+ if (integration.oauth) {
1656
+ const provider = integration.oauth.provider;
1657
+ try {
1658
+ const tokenData = await this.oauthManager.getProviderToken(provider);
1659
+ const currentState = this.authState.get(provider);
1660
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1661
+ this.authState.set(provider, { authenticated: !!tokenData });
1662
+ }
1663
+ } catch (error) {
1664
+ console.error(`Failed to check token for ${provider}:`, error);
1665
+ const currentState = this.authState.get(provider);
1666
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1667
+ this.authState.set(provider, { authenticated: false });
1668
+ }
1627
1669
  }
1628
- } catch (error) {
1629
- console.error(`Failed to check token for ${provider}:`, error);
1630
- const currentState = this.authState.get(provider);
1631
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1632
- this.authState.set(provider, { authenticated: false });
1670
+ }
1671
+ }
1672
+ }).catch((error) => {
1673
+ console.error("Failed to load provider tokens:", error);
1674
+ });
1675
+ } else {
1676
+ if (!hasOAuthCallback) {
1677
+ this.oauthManager.loadAllProviderTokensSync(providers);
1678
+ for (const integration of this.integrations) {
1679
+ if (integration.oauth) {
1680
+ const provider = integration.oauth.provider;
1681
+ const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
1682
+ if (tokenData) {
1683
+ this.authState.set(provider, { authenticated: true });
1633
1684
  }
1634
1685
  }
1635
1686
  }
1636
- }
1637
- }).catch((error) => {
1638
- console.error("Failed to load provider tokens:", error);
1639
- });
1687
+ } else {}
1688
+ }
1640
1689
  const integrationIds = this.integrations.map((i) => i.id);
1641
1690
  if (integrationIds.includes("github")) {
1642
1691
  this.github = this.createIntegrationProxy("github");
@@ -1944,10 +1993,18 @@ class MCPClientBase {
1944
1993
  isProviderAuthenticated(provider) {
1945
1994
  return this.authState.get(provider)?.authenticated ?? false;
1946
1995
  }
1947
- isAuthorized(provider) {
1996
+ async isAuthorized(provider) {
1997
+ if (this.oauthCallbackPromise) {
1998
+ await this.oauthCallbackPromise;
1999
+ this.oauthCallbackPromise = null;
2000
+ }
1948
2001
  return this.authState.get(provider)?.authenticated ?? false;
1949
2002
  }
1950
- authorizedProviders() {
2003
+ async authorizedProviders() {
2004
+ if (this.oauthCallbackPromise) {
2005
+ await this.oauthCallbackPromise;
2006
+ this.oauthCallbackPromise = null;
2007
+ }
1951
2008
  const authorized = [];
1952
2009
  for (const integration of this.integrations) {
1953
2010
  if (integration.oauth) {
@@ -2122,14 +2179,14 @@ function createMCPClient(config) {
2122
2179
  });
2123
2180
  }
2124
2181
  if (config.autoHandleOAuthCallback !== false) {
2125
- processOAuthCallbackFromHash(client, config.oauthCallbackErrorBehavior);
2182
+ client.oauthCallbackPromise = processOAuthCallbackFromHash(client, config.oauthCallbackErrorBehavior);
2126
2183
  }
2127
2184
  return client;
2128
2185
  }
2129
2186
  }
2130
2187
  function processOAuthCallbackFromHash(client, errorBehavior) {
2131
2188
  if (typeof window === "undefined" || !window.location) {
2132
- return;
2189
+ return null;
2133
2190
  }
2134
2191
  const mode = errorBehavior?.mode || "silent";
2135
2192
  try {
@@ -2140,17 +2197,32 @@ function processOAuthCallbackFromHash(client, errorBehavior) {
2140
2197
  if (oauthCallbackData) {
2141
2198
  const callbackParams = JSON.parse(decodeURIComponent(oauthCallbackData));
2142
2199
  if (callbackParams.code && callbackParams.state) {
2143
- client.handleOAuthCallback(callbackParams).catch((error) => {
2200
+ return client.handleOAuthCallback(callbackParams).then(() => {
2201
+ const providers = client.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
2202
+ client.oauthManager.loadAllProviderTokensSync(providers);
2203
+ for (const integration of client.integrations) {
2204
+ if (integration.oauth) {
2205
+ const provider = integration.oauth.provider;
2206
+ const tokenData = client.oauthManager.getProviderTokenFromCache(provider);
2207
+ if (tokenData) {
2208
+ client.authState.set(provider, { authenticated: true });
2209
+ }
2210
+ }
2211
+ }
2212
+ if (mode !== "redirect" || !errorBehavior?.redirectUrl) {
2213
+ window.history.replaceState(null, "", window.location.pathname + window.location.search);
2214
+ }
2215
+ }).catch((error) => {
2144
2216
  if (mode === "console") {
2145
2217
  console.error("Failed to process OAuth callback:", error);
2146
2218
  } else if (mode === "redirect" && errorBehavior?.redirectUrl) {
2147
2219
  window.location.href = errorBehavior.redirectUrl;
2148
2220
  return;
2149
2221
  }
2222
+ if (mode !== "redirect" || !errorBehavior?.redirectUrl) {
2223
+ window.history.replaceState(null, "", window.location.pathname + window.location.search);
2224
+ }
2150
2225
  });
2151
- if (mode !== "redirect" || !errorBehavior?.redirectUrl) {
2152
- window.history.replaceState(null, "", window.location.pathname + window.location.search);
2153
- }
2154
2226
  }
2155
2227
  }
2156
2228
  }
@@ -2159,7 +2231,7 @@ function processOAuthCallbackFromHash(client, errorBehavior) {
2159
2231
  console.error("Failed to process OAuth callback from hash:", error);
2160
2232
  } else if (mode === "redirect" && errorBehavior?.redirectUrl) {
2161
2233
  window.location.href = errorBehavior.redirectUrl;
2162
- return;
2234
+ return null;
2163
2235
  }
2164
2236
  try {
2165
2237
  if (mode !== "redirect" || !errorBehavior?.redirectUrl) {
@@ -2167,6 +2239,7 @@ function processOAuthCallbackFromHash(client, errorBehavior) {
2167
2239
  }
2168
2240
  } catch {}
2169
2241
  }
2242
+ return null;
2170
2243
  }
2171
2244
  async function clearClientCache() {
2172
2245
  const clients = Array.from(clientCache.values());
package/dist/server.js CHANGED
@@ -1306,6 +1306,9 @@ class OAuthManager {
1306
1306
  getAllProviderTokens() {
1307
1307
  return new Map(this.providerTokens);
1308
1308
  }
1309
+ getProviderTokenFromCache(provider) {
1310
+ return this.providerTokens.get(provider);
1311
+ }
1309
1312
  async setProviderToken(provider, tokenData, context) {
1310
1313
  this.providerTokens.set(provider, tokenData);
1311
1314
  await this.saveProviderToken(provider, tokenData, context);
@@ -1400,6 +1403,34 @@ class OAuthManager {
1400
1403
  }
1401
1404
  }
1402
1405
  }
1406
+ loadProviderTokenSync(provider) {
1407
+ if (this.getTokenCallback) {
1408
+ return;
1409
+ }
1410
+ if (typeof window !== "undefined" && window.localStorage) {
1411
+ try {
1412
+ const key = `integrate_token_${provider}`;
1413
+ const stored = window.localStorage.getItem(key);
1414
+ if (stored) {
1415
+ return JSON.parse(stored);
1416
+ }
1417
+ } catch (error) {
1418
+ console.error(`Failed to load token for ${provider} from localStorage:`, error);
1419
+ }
1420
+ }
1421
+ return;
1422
+ }
1423
+ loadAllProviderTokensSync(providers) {
1424
+ if (this.getTokenCallback) {
1425
+ return;
1426
+ }
1427
+ for (const provider of providers) {
1428
+ const tokenData = this.loadProviderTokenSync(provider);
1429
+ if (tokenData) {
1430
+ this.providerTokens.set(provider, tokenData);
1431
+ }
1432
+ }
1433
+ }
1403
1434
  savePendingAuthToStorage(state, pendingAuth) {
1404
1435
  if (typeof window !== "undefined" && window.localStorage) {
1405
1436
  try {
@@ -1563,6 +1594,7 @@ class MCPClientBase {
1563
1594
  eventEmitter = new SimpleEventEmitter;
1564
1595
  apiRouteBase;
1565
1596
  apiBaseUrl;
1597
+ oauthCallbackPromise;
1566
1598
  server;
1567
1599
  constructor(config) {
1568
1600
  this.transport = new HttpSessionTransport({
@@ -1606,28 +1638,45 @@ class MCPClientBase {
1606
1638
  }
1607
1639
  }
1608
1640
  const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
1609
- this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1610
- for (const integration of this.integrations) {
1611
- if (integration.oauth) {
1612
- const provider = integration.oauth.provider;
1613
- try {
1614
- const tokenData = await this.oauthManager.getProviderToken(provider);
1615
- const currentState = this.authState.get(provider);
1616
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1617
- this.authState.set(provider, { authenticated: !!tokenData });
1641
+ const hasOAuthCallback = typeof window !== "undefined" && window.location && window.location.hash && window.location.hash.includes("oauth_callback=");
1642
+ const usingDatabaseCallbacks = !!config.getProviderToken;
1643
+ if (usingDatabaseCallbacks) {
1644
+ this.oauthManager.loadAllProviderTokens(providers).then(async () => {
1645
+ for (const integration of this.integrations) {
1646
+ if (integration.oauth) {
1647
+ const provider = integration.oauth.provider;
1648
+ try {
1649
+ const tokenData = await this.oauthManager.getProviderToken(provider);
1650
+ const currentState = this.authState.get(provider);
1651
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1652
+ this.authState.set(provider, { authenticated: !!tokenData });
1653
+ }
1654
+ } catch (error) {
1655
+ console.error(`Failed to check token for ${provider}:`, error);
1656
+ const currentState = this.authState.get(provider);
1657
+ if (currentState && !currentState.authenticated && !currentState.lastError) {
1658
+ this.authState.set(provider, { authenticated: false });
1659
+ }
1618
1660
  }
1619
- } catch (error) {
1620
- console.error(`Failed to check token for ${provider}:`, error);
1621
- const currentState = this.authState.get(provider);
1622
- if (currentState && !currentState.authenticated && !currentState.lastError) {
1623
- this.authState.set(provider, { authenticated: false });
1661
+ }
1662
+ }
1663
+ }).catch((error) => {
1664
+ console.error("Failed to load provider tokens:", error);
1665
+ });
1666
+ } else {
1667
+ if (!hasOAuthCallback) {
1668
+ this.oauthManager.loadAllProviderTokensSync(providers);
1669
+ for (const integration of this.integrations) {
1670
+ if (integration.oauth) {
1671
+ const provider = integration.oauth.provider;
1672
+ const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
1673
+ if (tokenData) {
1674
+ this.authState.set(provider, { authenticated: true });
1624
1675
  }
1625
1676
  }
1626
1677
  }
1627
- }
1628
- }).catch((error) => {
1629
- console.error("Failed to load provider tokens:", error);
1630
- });
1678
+ } else {}
1679
+ }
1631
1680
  const integrationIds = this.integrations.map((i) => i.id);
1632
1681
  if (integrationIds.includes("github")) {
1633
1682
  this.github = this.createIntegrationProxy("github");
@@ -1935,10 +1984,18 @@ class MCPClientBase {
1935
1984
  isProviderAuthenticated(provider) {
1936
1985
  return this.authState.get(provider)?.authenticated ?? false;
1937
1986
  }
1938
- isAuthorized(provider) {
1987
+ async isAuthorized(provider) {
1988
+ if (this.oauthCallbackPromise) {
1989
+ await this.oauthCallbackPromise;
1990
+ this.oauthCallbackPromise = null;
1991
+ }
1939
1992
  return this.authState.get(provider)?.authenticated ?? false;
1940
1993
  }
1941
- authorizedProviders() {
1994
+ async authorizedProviders() {
1995
+ if (this.oauthCallbackPromise) {
1996
+ await this.oauthCallbackPromise;
1997
+ this.oauthCallbackPromise = null;
1998
+ }
1942
1999
  const authorized = [];
1943
2000
  for (const integration of this.integrations) {
1944
2001
  if (integration.oauth) {
@@ -60,6 +60,11 @@ export declare class MCPClientBase<TIntegrations extends readonly MCPIntegration
60
60
  private eventEmitter;
61
61
  private apiRouteBase;
62
62
  private apiBaseUrl?;
63
+ /**
64
+ * Promise that resolves when OAuth callback processing is complete
65
+ * @internal Used by createMCPClient to store callback promise
66
+ */
67
+ oauthCallbackPromise?: Promise<void> | null;
63
68
  readonly server: ServerIntegrationClient;
64
69
  constructor(config: MCPClientConfig<TIntegrations>);
65
70
  /**
@@ -266,29 +271,34 @@ export declare class MCPClientBase<TIntegrations extends readonly MCPIntegration
266
271
  * Returns the cached authorization status that is automatically updated when
267
272
  * authorize() or disconnectProvider() are called
268
273
  *
274
+ * Automatically waits for any pending OAuth callback to complete, ensuring
275
+ * the auth state is always up-to-date, even immediately after OAuth redirects
276
+ *
269
277
  * @param provider - Provider name (github, gmail, etc.)
270
- * @returns Authorization status from cache
278
+ * @returns Promise that resolves to authorization status
271
279
  *
272
280
  * @example
273
281
  * ```typescript
274
- * const isAuthorized = client.isAuthorized('github');
282
+ * const isAuthorized = await client.isAuthorized('github');
275
283
  * if (!isAuthorized) {
276
284
  * await client.authorize('github');
277
285
  * // isAuthorized is now automatically true
278
- * console.log(client.isAuthorized('github')); // true
286
+ * console.log(await client.isAuthorized('github')); // true
279
287
  * }
280
288
  * ```
281
289
  */
282
- isAuthorized(provider: string): boolean;
290
+ isAuthorized(provider: string): Promise<boolean>;
283
291
  /**
284
292
  * Get list of all authorized providers
285
293
  * Returns cached authorization status for all configured OAuth providers
286
294
  *
287
- * @returns Array of authorized provider names
295
+ * Automatically waits for any pending OAuth callback to complete
296
+ *
297
+ * @returns Promise that resolves to array of authorized provider names
288
298
  *
289
299
  * @example
290
300
  * ```typescript
291
- * const authorized = client.authorizedProviders();
301
+ * const authorized = await client.authorizedProviders();
292
302
  * console.log('Authorized services:', authorized); // ['github', 'gmail']
293
303
  *
294
304
  * // Check if specific service is in the list
@@ -297,7 +307,7 @@ export declare class MCPClientBase<TIntegrations extends readonly MCPIntegration
297
307
  * }
298
308
  * ```
299
309
  */
300
- authorizedProviders(): string[];
310
+ authorizedProviders(): Promise<string[]>;
301
311
  /**
302
312
  * Get detailed authorization status for a provider
303
313
  *
@@ -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,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BG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmClF;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;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;AAoGD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAetD"}
@@ -111,6 +111,13 @@ export declare class OAuthManager {
111
111
  * Get all provider tokens
112
112
  */
113
113
  getAllProviderTokens(): Map<string, ProviderTokenData>;
114
+ /**
115
+ * Get provider token from in-memory cache synchronously
116
+ * Only returns cached tokens, does not call database callbacks
117
+ * Used for immediate synchronous checks after tokens are loaded
118
+ * @param provider - Provider name (e.g., 'github', 'gmail')
119
+ */
120
+ getProviderTokenFromCache(provider: string): ProviderTokenData | undefined;
114
121
  /**
115
122
  * Set provider token (for manual token management)
116
123
  * Uses callback if provided, otherwise uses localStorage
@@ -152,6 +159,19 @@ export declare class OAuthManager {
152
159
  * Load all provider tokens from database (via callback) or localStorage on initialization
153
160
  */
154
161
  loadAllProviderTokens(providers: string[]): Promise<void>;
162
+ /**
163
+ * Load provider token synchronously from localStorage only
164
+ * Returns undefined if not found or if using database callbacks
165
+ * This method is synchronous and should only be used during initialization
166
+ * when database callbacks are NOT configured
167
+ */
168
+ private loadProviderTokenSync;
169
+ /**
170
+ * Load all provider tokens synchronously from localStorage on initialization
171
+ * Only works when database callbacks are NOT configured
172
+ * This ensures tokens are available immediately for isAuthorized() calls
173
+ */
174
+ loadAllProviderTokensSync(providers: string[]): void;
155
175
  /**
156
176
  * Save pending auth to localStorage (for redirect flows)
157
177
  * Uses localStorage instead of sessionStorage because OAuth may open in a new tab,
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EAGV,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,gBAAgB,CAAC,CAAqH;IAC9I,OAAO,CAAC,gBAAgB,CAAC,CAAiG;gBAGx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C,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAI1E;;;;;;OAMG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3G;;;;OAIG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAa1C;;;;OAIG;IACH,sBAAsB,IAAI,IAAI;IAgB9B;;;OAGG;IACH,oBAAoB,IAAI,IAAI;IAwB5B;;;;;OAKG;YACW,iBAAiB;IAuB/B;;;OAGG;YACW,iBAAiB;IA0B/B;;OAEG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/D;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;OAIG;IACH,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAcpD;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAelC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAWpC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAoClC;;;OAGG;YACW,mBAAmB;IAoCjC;;;OAGG;YACW,oBAAoB;IAkClC;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integrate-sdk",
3
- "version": "0.7.57",
3
+ "version": "0.7.60",
4
4
  "description": "Type-safe 3rd party integration SDK for the Integrate MCP server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",