@metrifox/react-sdk 0.0.4 → 0.0.6
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 +15 -16
- package/dist/index.cjs +17 -17
- package/dist/index.d.ts +1 -16
- package/dist/index.js +17 -17
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,18 +21,17 @@ yarn add @metrifox/react-sdk
|
|
|
21
21
|
|
|
22
22
|
## Setup
|
|
23
23
|
|
|
24
|
-
Before using any SDK components, initialize it once with your
|
|
24
|
+
Before using any SDK components, initialize it once with your Client key.
|
|
25
25
|
|
|
26
26
|
```tsx
|
|
27
27
|
import { metrifoxInit } from "@metrifox/react-sdk"
|
|
28
28
|
|
|
29
29
|
metrifoxInit({
|
|
30
|
-
|
|
31
|
-
process.env.
|
|
32
|
-
process.env.
|
|
33
|
-
import.meta.env?.
|
|
34
|
-
"your-
|
|
35
|
-
// baseUrl: "https://api.example.com" // Optional (defaults to Metrifox Cloud)
|
|
30
|
+
clientKey:
|
|
31
|
+
process.env.NEXT_PUBLIC_METRIFOX_APP_SECRET ||
|
|
32
|
+
process.env.REACT_APP_METRIFOX_APP_SECRET ||
|
|
33
|
+
import.meta.env?.VITE_METRIFOX_APP_SECRET ||
|
|
34
|
+
"your-client-key",
|
|
36
35
|
})
|
|
37
36
|
```
|
|
38
37
|
|
|
@@ -92,15 +91,15 @@ The `sectionsConfig` prop controls what appears in the portal.
|
|
|
92
91
|
|
|
93
92
|
Each portal section now renders inside a `<section id="...">` wrapper so you can link directly to segments of a customer portal view. The default anchor IDs are:
|
|
94
93
|
|
|
95
|
-
| Anchor ID
|
|
96
|
-
|
|
|
97
|
-
| `#upcoming-invoice`
|
|
98
|
-
| `#subscription`
|
|
99
|
-
| `#credit-balance`
|
|
100
|
-
| `#entitlement-usage
|
|
101
|
-
| `#payment-overview`
|
|
102
|
-
| `#billing-history`
|
|
103
|
-
| `#plan`
|
|
94
|
+
| Anchor ID | Section Key |
|
|
95
|
+
| -------------------- | ------------------ |
|
|
96
|
+
| `#upcoming-invoice` | `upcomingInvoice` |
|
|
97
|
+
| `#subscription` | `subscription` |
|
|
98
|
+
| `#credit-balance` | `creditBalance` |
|
|
99
|
+
| `#entitlement-usage` | `entitlementUsage` |
|
|
100
|
+
| `#payment-overview` | `paymentOverview` |
|
|
101
|
+
| `#billing-history` | `billingHistory` |
|
|
102
|
+
| `#plan` | `plan` |
|
|
104
103
|
|
|
105
104
|
Use these anchors when embedding the SDK or sharing deep links (e.g., `https://app.example.com/portal#billing-history`).
|
|
106
105
|
|