@praxium/sdk 0.3.49 → 0.3.50

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 +30 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -52,14 +52,42 @@ const label = localizeText(team[0].customFields[0].label, 'nl') // → "Special
52
52
  const value = localizeText(team[0].customFields[0].value, 'nl') // → "Sport"
53
53
  ```
54
54
 
55
+ ### Contact Form
56
+
57
+ ```typescript
58
+ const result = await client.submitContactForm({
59
+ name: 'Jan de Vries',
60
+ email: 'jan@example.nl',
61
+ phone: '+31612345678',
62
+ subject: 'Afspraak maken',
63
+ message: 'Ik wil graag een afspraak maken.',
64
+ })
65
+ // → { success: true, emailStatus: 'sent' }
66
+ ```
67
+
55
68
  ## Next.js Revalidation
56
69
 
57
- Optional utilities for ISR cache revalidation (requires `next` as peer dependency):
70
+ When an admin updates data (team, FAQ, opening hours), a webhook triggers cache revalidation on the tenant website. The SDK handles HMAC signature verification and path resolution.
58
71
 
59
72
  ```typescript
60
- import { revalidatePublicPages } from '@praxium/sdk/revalidation'
73
+ // app/api/revalidate/route.ts
74
+ import { createRevalidationHandler } from '@praxium/sdk/revalidation'
75
+
76
+ export const POST = createRevalidationHandler({
77
+ secret: process.env.PRAXIUM_REVALIDATION_SECRET!,
78
+ pathMap: {
79
+ // entity → locale-prefixed paths to revalidate
80
+ 'team': ['/nl/team', '/en/team'],
81
+ 'rates': ['/nl/tarieven', '/en/rates'],
82
+ 'faq': ['/nl/faq', '/en/faq'],
83
+ 'opening-hours': ['/nl', '/en'],
84
+ 'all': ['/nl', '/en'],
85
+ },
86
+ })
61
87
  ```
62
88
 
89
+ Security: HMAC-SHA256 signature verification, timestamp-based replay protection (5-min window), timing-safe comparison. Requires `next` as peer dependency.
90
+
63
91
  ## Development
64
92
 
65
93
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxium/sdk",
3
- "version": "0.3.49",
3
+ "version": "0.3.50",
4
4
  "description": "Official TypeScript SDK for the Praxium platform API",
5
5
  "type": "module",
6
6
  "exports": {