@praxium/sdk 0.3.80 → 0.4.83
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 +2 -2
- package/dist/index.d.ts +4 -7
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Your website needs two environment variables to connect to the Praxium platform,
|
|
|
86
86
|
| Variable | Purpose | Example |
|
|
87
87
|
|----------|---------|---------|
|
|
88
88
|
| `PRAXIUM_API_URL` | Your tenant's admin portal URL. The SDK sends API requests to this host. | `https://mypractice.admin.praxium.nl` |
|
|
89
|
-
| `PRAXIUM_API_KEY` | HMAC API key for authentication. Generated in the admin portal under API Profiles. The tenant slug is embedded in the key — no need to configure it separately. | `
|
|
89
|
+
| `PRAXIUM_API_KEY` | HMAC API key for authentication. Generated in the admin portal under API Profiles. The tenant slug is embedded in the key — no need to configure it separately. | `praxium_v1_mypractice_default_17..._abc...` |
|
|
90
90
|
|
|
91
91
|
**Optional (only if using ISR revalidation webhooks):**
|
|
92
92
|
|
|
@@ -97,7 +97,7 @@ Your website needs two environment variables to connect to the Praxium platform,
|
|
|
97
97
|
```bash
|
|
98
98
|
# .env.local
|
|
99
99
|
PRAXIUM_API_URL="https://mypractice.admin.praxium.nl"
|
|
100
|
-
PRAXIUM_API_KEY="
|
|
100
|
+
PRAXIUM_API_KEY="praxium_v1_mypractice_default_1234567890_abcdef..."
|
|
101
101
|
PRAXIUM_WEBHOOK_SECRET="your-webhook-secret-from-admin-portal" # optional
|
|
102
102
|
```
|
|
103
103
|
|
package/dist/index.d.ts
CHANGED
|
@@ -593,10 +593,7 @@ type SubmitContactFormData = {
|
|
|
593
593
|
phone?: string;
|
|
594
594
|
subject: string;
|
|
595
595
|
message: string;
|
|
596
|
-
|
|
597
|
-
* User must explicitly accept terms and privacy policy (GDPR compliance)
|
|
598
|
-
*/
|
|
599
|
-
acceptTerms: true;
|
|
596
|
+
acceptTerms: boolean;
|
|
600
597
|
};
|
|
601
598
|
path: {
|
|
602
599
|
/**
|
|
@@ -677,8 +674,8 @@ type ClientLocale = SupportedLocale | '*';
|
|
|
677
674
|
/**
|
|
678
675
|
* Extract the tenant slug from a profile-scoped API key.
|
|
679
676
|
*
|
|
680
|
-
* Key format:
|
|
681
|
-
* Parts: [0]
|
|
677
|
+
* Key format: praxium_v1_{tenantSlug}_{profileSlug}_{timestamp}_{signature}
|
|
678
|
+
* Parts: [0]praxium [1]v1 [2]tenantSlug [3]profileSlug [4]timestamp [5]signature
|
|
682
679
|
*
|
|
683
680
|
* @throws Error if key format is invalid (wrong prefix or insufficient parts)
|
|
684
681
|
*/
|
|
@@ -686,7 +683,7 @@ declare function extractTenantSlugFromApiKey(apiKey: string): string;
|
|
|
686
683
|
interface PraxiumClientConfig {
|
|
687
684
|
/** Platform base URL (e.g., 'https://platform.praxium.nl') */
|
|
688
685
|
baseUrl: string;
|
|
689
|
-
/** HMAC-signed API key (format:
|
|
686
|
+
/** HMAC-signed API key (format: praxium_v1_{tenantSlug}_{profileSlug}_{timestamp}_{signature}) */
|
|
690
687
|
apiKey: string;
|
|
691
688
|
/** Locale for server-side content resolution */
|
|
692
689
|
locale: ClientLocale;
|
package/dist/index.js
CHANGED
|
@@ -929,7 +929,7 @@ var STATUS_ERROR_MAP = {
|
|
|
929
929
|
};
|
|
930
930
|
|
|
931
931
|
// src/tenant-client.ts
|
|
932
|
-
var API_KEY_PREFIX = "
|
|
932
|
+
var API_KEY_PREFIX = "praxium_v1";
|
|
933
933
|
var API_KEY_SEPARATOR = "_";
|
|
934
934
|
function extractTenantSlugFromApiKey(apiKey) {
|
|
935
935
|
const parts = apiKey.split(API_KEY_SEPARATOR);
|
|
@@ -937,7 +937,7 @@ function extractTenantSlugFromApiKey(apiKey) {
|
|
|
937
937
|
throw new PraxiumError(
|
|
938
938
|
400,
|
|
939
939
|
"INVALID_API_KEY_FORMAT",
|
|
940
|
-
`API key must start with '${API_KEY_PREFIX}' and contain at least 6 segments. Format:
|
|
940
|
+
`API key must start with '${API_KEY_PREFIX}' and contain at least 6 segments. Format: praxium_v1_{tenantSlug}_{profileSlug}_{timestamp}_{signature}`
|
|
941
941
|
);
|
|
942
942
|
}
|
|
943
943
|
return parts[2];
|