@23blocks/react 7.0.4 → 7.1.0

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.
Files changed (2) hide show
  1. package/README.md +12 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -149,6 +149,9 @@ export function ProductList() {
149
149
 
150
150
  // Optional: Token storage (default: 'localStorage')
151
151
  storage="localStorage" // 'localStorage' | 'sessionStorage' | 'memory'
152
+
153
+ // Optional: Enable debug logging
154
+ debug={process.env.NODE_ENV === 'development'}
152
155
  >
153
156
  ```
154
157
 
@@ -523,6 +526,8 @@ export default async function ProductsPage() {
523
526
 
524
527
  ## Error Handling
525
528
 
529
+ Every error includes a unique request ID for easy debugging and support:
530
+
526
531
  ```tsx
527
532
  import { isBlockErrorException, ErrorCodes } from '@23blocks/contracts';
528
533
 
@@ -531,6 +536,10 @@ const handleSubmit = async () => {
531
536
  await signIn({ email, password });
532
537
  } catch (err) {
533
538
  if (isBlockErrorException(err)) {
539
+ // Request tracing for debugging
540
+ console.log('Request ID:', err.requestId); // "req_m5abc_xyz123"
541
+ console.log('Duration:', err.duration); // 145 (ms)
542
+
534
543
  switch (err.code) {
535
544
  case ErrorCodes.INVALID_CREDENTIALS:
536
545
  setError('Invalid email or password');
@@ -544,6 +553,9 @@ const handleSubmit = async () => {
544
553
  default:
545
554
  setError(err.message);
546
555
  }
556
+
557
+ // Send request ID to support for debugging
558
+ // "Please check request req_m5abc_xyz123"
547
559
  }
548
560
  }
549
561
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@23blocks/react",
3
- "version": "7.0.4",
3
+ "version": "7.1.0",
4
4
  "description": "React bindings for 23blocks SDK - hooks and context providers",
5
5
  "license": "MIT",
6
6
  "author": "23blocks <hello@23blocks.com>",