@towns-protocol/react-sdk 0.0.349 → 0.0.350

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
@@ -26,12 +26,12 @@ import {
26
26
  TownsSyncProvider,
27
27
  useAgentConnection,
28
28
  } from "@towns-protocol/react-sdk";
29
- import { makeRiverConfig } from "@towns-protocol/sdk";
29
+ import { townsEnv } from "@towns-protocol/sdk";
30
30
  import { WagmiProvider } from "wagmi";
31
31
  import { useEthersSigner } from "./utils/viem-to-ethers";
32
32
  import { wagmiConfig } from "./config/wagmi";
33
33
 
34
- const riverConfig = makeRiverConfig("gamma");
34
+ const townsConfig = townsEnv().makeTownsConfig("gamma");
35
35
 
36
36
  const App = ({ children }: { children: React.ReactNode }) => {
37
37
  return (
@@ -52,7 +52,7 @@ const ConnectTowns = () => {
52
52
  if (!signer) {
53
53
  return;
54
54
  }
55
- connect(signer, { riverConfig });
55
+ connect(signer, { townsConfig });
56
56
  }}
57
57
  >
58
58
  {isConnecting ? "Disconnect" : "Connect"}
@@ -9,10 +9,10 @@ import { useTownsSync } from './internals/useTownsSync';
9
9
  * ### Bearer Token
10
10
  * ```tsx
11
11
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
12
- * import { makeRiverConfig } from '@towns-protocol/sdk'
12
+ * import { townsEnv } from '@towns-protocol/sdk'
13
13
  * import { useState } from 'react'
14
14
  *
15
- * const riverConfig = makeRiverConfig('gamma')
15
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
16
16
  *
17
17
  * const Login = () => {
18
18
  * const { connectUsingBearerToken, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -21,7 +21,7 @@ import { useTownsSync } from './internals/useTownsSync';
21
21
  * return (
22
22
  * <>
23
23
  * <input value={bearerToken} onChange={(e) => setBearerToken(e.target.value)} />
24
- * <button onClick={() => connectUsingBearerToken(bearerToken, { riverConfig })}>
24
+ * <button onClick={() => connectUsingBearerToken(bearerToken, { townsConfig })}>
25
25
  * Login
26
26
  * </button>
27
27
  * {isAgentConnecting && <span>Connecting... ⏳</span>}
@@ -37,10 +37,10 @@ import { useTownsSync } from './internals/useTownsSync';
37
37
  *
38
38
  * ```tsx
39
39
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
40
- * import { makeRiverConfig } from '@towns-protocol/sdk'
40
+ * import { townsEnv } from '@towns-protocol/sdk'
41
41
  * import { useEthersSigner } from './utils/viem-to-ethers'
42
42
  *
43
- * const riverConfig = makeRiverConfig('gamma')
43
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
44
44
  *
45
45
  * const Login = () => {
46
46
  * const { connect, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -52,7 +52,7 @@ import { useTownsSync } from './internals/useTownsSync';
52
52
  * if (!signer) {
53
53
  * return
54
54
  * }
55
- * connect(signer, { riverConfig })
55
+ * connect(signer, { townsConfig })
56
56
  * }}>
57
57
  * Login
58
58
  * </button>
@@ -122,7 +122,7 @@ export const useAgentConnection = () => {
122
122
  /** Whether the agent is connected */
123
123
  isAgentConnected,
124
124
  /** The environment of the current connection (gamma, omega, alpha, local_dev, etc.) */
125
- env: towns?.syncAgent?.config.riverConfig.environmentId,
125
+ env: towns?.syncAgent?.config.townsConfig.environmentId,
126
126
  };
127
127
  };
128
128
  //# sourceMappingURL=useAgentConnection.js.map
@@ -9,10 +9,10 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>;
9
9
  * ### Bearer Token
10
10
  * ```tsx
11
11
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
12
- * import { makeRiverConfig } from '@towns-protocol/sdk'
12
+ * import { townsEnv } from '@towns-protocol/sdk'
13
13
  * import { useState } from 'react'
14
14
  *
15
- * const riverConfig = makeRiverConfig('gamma')
15
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
16
16
  *
17
17
  * const Login = () => {
18
18
  * const { connectUsingBearerToken, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -21,7 +21,7 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>;
21
21
  * return (
22
22
  * <>
23
23
  * <input value={bearerToken} onChange={(e) => setBearerToken(e.target.value)} />
24
- * <button onClick={() => connectUsingBearerToken(bearerToken, { riverConfig })}>
24
+ * <button onClick={() => connectUsingBearerToken(bearerToken, { townsConfig })}>
25
25
  * Login
26
26
  * </button>
27
27
  * {isAgentConnecting && <span>Connecting... ⏳</span>}
@@ -37,10 +37,10 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>;
37
37
  *
38
38
  * ```tsx
39
39
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
40
- * import { makeRiverConfig } from '@towns-protocol/sdk'
40
+ * import { townsEnv } from '@towns-protocol/sdk'
41
41
  * import { useEthersSigner } from './utils/viem-to-ethers'
42
42
  *
43
- * const riverConfig = makeRiverConfig('gamma')
43
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
44
44
  *
45
45
  * const Login = () => {
46
46
  * const { connect, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -52,7 +52,7 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>;
52
52
  * if (!signer) {
53
53
  * return
54
54
  * }
55
- * connect(signer, { riverConfig })
55
+ * connect(signer, { townsConfig })
56
56
  * }}>
57
57
  * Login
58
58
  * </button>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@towns-protocol/react-sdk",
3
3
  "description": "React Hooks for Towns Protocol SDK",
4
- "version": "0.0.349",
4
+ "version": "0.0.350",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
7
7
  "types": "./dist/types/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "watch": "yarn build -w"
19
19
  },
20
20
  "dependencies": {
21
- "@towns-protocol/sdk": "^0.0.349",
21
+ "@towns-protocol/sdk": "^0.0.350",
22
22
  "ethers": "^5.7.2"
23
23
  },
24
24
  "devDependencies": {
@@ -70,5 +70,5 @@
70
70
  },
71
71
  "sideEffects": false,
72
72
  "typings": "./dist/types/index.d.ts",
73
- "gitHead": "203975e546c212816a5086c7c97a17c3f45b139f"
73
+ "gitHead": "70b93a91561828fdf48dabf6709d1cd73177ceff"
74
74
  }
@@ -14,10 +14,10 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>
14
14
  * ### Bearer Token
15
15
  * ```tsx
16
16
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
17
- * import { makeRiverConfig } from '@towns-protocol/sdk'
17
+ * import { townsEnv } from '@towns-protocol/sdk'
18
18
  * import { useState } from 'react'
19
19
  *
20
- * const riverConfig = makeRiverConfig('gamma')
20
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
21
21
  *
22
22
  * const Login = () => {
23
23
  * const { connectUsingBearerToken, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -26,7 +26,7 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>
26
26
  * return (
27
27
  * <>
28
28
  * <input value={bearerToken} onChange={(e) => setBearerToken(e.target.value)} />
29
- * <button onClick={() => connectUsingBearerToken(bearerToken, { riverConfig })}>
29
+ * <button onClick={() => connectUsingBearerToken(bearerToken, { townsConfig })}>
30
30
  * Login
31
31
  * </button>
32
32
  * {isAgentConnecting && <span>Connecting... ⏳</span>}
@@ -42,10 +42,10 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>
42
42
  *
43
43
  * ```tsx
44
44
  * import { useAgentConnection } from '@towns-protocol/react-sdk'
45
- * import { makeRiverConfig } from '@towns-protocol/sdk'
45
+ * import { townsEnv } from '@towns-protocol/sdk'
46
46
  * import { useEthersSigner } from './utils/viem-to-ethers'
47
47
  *
48
- * const riverConfig = makeRiverConfig('gamma')
48
+ * const townsConfig = townsEnv().makeTownsConfig('gamma')
49
49
  *
50
50
  * const Login = () => {
51
51
  * const { connect, isAgentConnecting, isAgentConnected } = useAgentConnection()
@@ -57,7 +57,7 @@ type AgentConnectConfig = Omit<SyncAgentConfig, 'context' | 'onTokenExpired'>
57
57
  * if (!signer) {
58
58
  * return
59
59
  * }
60
- * connect(signer, { riverConfig })
60
+ * connect(signer, { townsConfig })
61
61
  * }}>
62
62
  * Login
63
63
  * </button>
@@ -138,6 +138,6 @@ export const useAgentConnection = () => {
138
138
  /** Whether the agent is connected */
139
139
  isAgentConnected,
140
140
  /** The environment of the current connection (gamma, omega, alpha, local_dev, etc.) */
141
- env: towns?.syncAgent?.config.riverConfig.environmentId,
141
+ env: towns?.syncAgent?.config.townsConfig.environmentId,
142
142
  }
143
143
  }