@calimero-network/mero-react 1.0.2 → 2.0.1

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
@@ -2,15 +2,15 @@
2
2
 
3
3
  React bindings for [@calimero-network/mero-js](../mero-js) — the Calimero Network SDK.
4
4
 
5
- No UI components. No styled-components. No axios. Just a provider, hooks, and storage helpers.
5
+ No external UI framework. No styled-components. No axios. A provider, 44 hooks, storage helpers, and optional headless utility components (ConnectButton, LoginModal).
6
6
 
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- pnpm add @calimero-network/mero-react @calimero-network/mero-js
10
+ pnpm add @calimero-network/mero-react
11
11
  ```
12
12
 
13
- Peer dependencies: `react` ^18 || ^19, `react-dom` ^18 || ^19.
13
+ Peer dependencies: `react` ^18 || ^19, `react-dom` ^18 || ^19. `mero-js` is a bundled dependency — no separate install needed.
14
14
 
15
15
  ## Quick start
16
16
 
@@ -237,47 +237,71 @@ import {
237
237
  ## Enums
238
238
 
239
239
  ```tsx
240
-
241
240
  AppMode.SingleContext // 'single-context'
242
241
  AppMode.MultiContext // 'multi-context'
243
242
  AppMode.Admin // 'admin'
244
243
 
245
- ConnectionType.Custom // 'custom'
246
- ConnectionType.Local // 'local'
247
- ConnectionType.Remote // 'remote'
248
-
244
+ ConnectionType.RemoteAndLocal // 'remote-and-local'
245
+ ConnectionType.Remote // 'remote'
246
+ ConnectionType.Local // 'local'
247
+ ConnectionType.Custom // 'custom'
249
248
  ```
250
249
 
251
250
  ## Types
252
251
 
253
252
  ```tsx
254
253
  import type {
255
- MeroContextValue, // useMero() return type
256
- MeroProviderConfig, // MeroProvider props (without children)
257
- MeroProviderProps, // MeroProvider props (with children)
258
- CustomConnectionConfig,// { type: ConnectionType.Custom, url: string }
259
- AppContext, // { contextId, executorId, applicationId }
260
- ExecutionResult, // { success, result?, error? }
254
+ MeroContextValue, // useMero() return type
255
+ MeroProviderConfig, // MeroProvider props (without children)
256
+ MeroProviderProps, // MeroProvider props (with children)
257
+ CustomConnectionConfig, // { type: ConnectionType.Custom, url: string }
258
+ AppContext, // { contextId, executorId, applicationId }
259
+ ExecutionResult, // { success, result?, error? }
260
+ ApplicationContextRecord,// { contextId, applicationId }
261
+ ContextDiscoveryOptions, // options for useContextDiscovery
262
+ ContextDiscoveryState, // return type of useContextDiscovery
261
263
  } from '@calimero-network/mero-react';
262
264
  ```
263
265
 
264
266
  ## Full exports list
265
267
 
266
268
  ```
267
- // Provider & hooks (mero-react)
269
+ // Provider & context (mero-react)
268
270
  MeroProvider, useMero, MeroContext
269
- useExecute, useSubscription, useContexts
271
+
272
+ // Components (mero-react)
273
+ ConnectButton, LoginModal
270
274
 
271
275
  // Enums (mero-react)
276
+ AppMode, ConnectionType
277
+
278
+ // Hooks (mero-react)
279
+ useExecute, useSubscription
280
+ useContexts, useApplicationContexts, useContextGroup, useContextDiscovery
281
+ useCreateContext, useDeleteContext, useJoinContext
282
+ useGroupInfo, useGroupMembers, useGroupContexts, useGroupInvitations, useGroupCapabilities
283
+ useJoinGroup, useDeleteGroup, useAddGroupMembers, useRemoveGroupMembers
284
+ useSyncGroup, useNestGroup, useUnnestGroup, useSubgroups
285
+ useUpgradeGroup, useGroupUpgradeStatus, useRetryGroupUpgrade
286
+ useRegisterGroupSigningKey, useUpdateGroupSettings
287
+ useSetGroupAlias, useSetMemberAlias, useUpdateMemberRole
288
+ useSetDefaultCapabilities, useSetSubgroupVisibility, useSetTeeAdmissionPolicy
289
+ useDetachContextFromGroup
290
+ useNamespaces, useNamespace, useNamespaceGroups, useNamespaceIdentity
291
+ useNamespacesForApplication, useCreateNamespace, useDeleteNamespace
292
+ useJoinNamespace, useCreateNamespaceInvitation, useCreateGroupInNamespace
272
293
 
273
294
  // Types (mero-react)
274
295
  MeroContextValue, MeroProviderConfig, MeroProviderProps
275
296
  CustomConnectionConfig, AppContext, ExecutionResult
297
+ ApplicationContextRecord, ContextDiscoveryOptions, ContextDiscoveryState
276
298
 
277
299
  // Storage (mero-react)
278
300
  localStorageTokenStorage
279
301
  getNodeUrl, setNodeUrl, clearNodeUrl
280
302
  getApplicationId, setApplicationId, clearApplicationId
303
+ getContextId, setContextId, clearContextId
304
+ getContextIdentity, setContextIdentity, clearContextIdentity
281
305
  clearAllStorage
282
306
 
283
307
  // Everything from @calimero-network/mero-js (auto re-exported)