Skip to content

Commit 4101281

Browse files
committed
feat: Add package-specific usage example for React in README
1 parent 4511f6d commit 4101281

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/shared/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,29 @@ console.log(DEFAULT_CONFIG.apiBaseUrl);
6666
| `SUPPORTED_LOCALES` | Available languages |
6767
| `FILE_TYPES` | Supported file formats |
6868

69+
## Framework Integration
70+
71+
This package works with all JavaScript frameworks. See the [main README](../../README.md#framework-integration) for framework-specific integration examples.
72+
73+
### Package-specific Usage
74+
75+
```typescript
76+
// Example: Using shared utilities in React
77+
import { formatCurrency, encryptData } from '@mixcore/shared';
78+
79+
function ProductCard({ price }) {
80+
const formattedPrice = formatCurrency(price, 'USD');
81+
const encryptedId = encryptData(product.id, process.env.REACT_APP_ENCRYPT_KEY);
82+
83+
return (
84+
<div>
85+
<p>Price: {formattedPrice}</p>
86+
<p>ID: {encryptedId}</p>
87+
</div>
88+
);
89+
}
90+
```
91+
6992
## Related Packages
7093

7194
- [@mixcore/api](https://github.com/mixcore/javascript-sdk/tree/main/packages/api): API client using these utilities

0 commit comments

Comments
 (0)