@23blocks/react 7.0.4 → 7.1.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 +12 -0
- package/package.json +14 -5
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.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "React bindings for 23blocks SDK - hooks and context providers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "23blocks <hello@23blocks.com>",
|
|
@@ -15,11 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"23blocks",
|
|
18
|
-
"sdk",
|
|
19
18
|
"react",
|
|
20
|
-
"hooks",
|
|
21
|
-
"context",
|
|
22
|
-
"
|
|
19
|
+
"react-hooks",
|
|
20
|
+
"react-context",
|
|
21
|
+
"react-authentication",
|
|
22
|
+
"react-sdk",
|
|
23
|
+
"nextjs",
|
|
24
|
+
"nextjs-auth",
|
|
25
|
+
"react-api-client",
|
|
26
|
+
"use-auth",
|
|
27
|
+
"react-backend",
|
|
28
|
+
"react-ecommerce",
|
|
29
|
+
"react-crm",
|
|
30
|
+
"baas-react",
|
|
31
|
+
"typescript"
|
|
23
32
|
],
|
|
24
33
|
"type": "module",
|
|
25
34
|
"main": "./dist/index.esm.js",
|