@vigneshreddy/cms-sdk 1.0.1 → 1.0.2
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 +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ This SDK is:
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install @
|
|
13
|
+
npm install @vigneshreddy/cms-sdk
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Runtime requirements
|
|
@@ -37,7 +37,7 @@ global.Response = Response as any;
|
|
|
37
37
|
Create the client once and reuse it across calls.
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
|
-
import { CMS } from "@
|
|
40
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
41
41
|
|
|
42
42
|
const sdk = new CMS({
|
|
43
43
|
apiKey: process.env.CMS_API_KEY!,
|
|
@@ -50,7 +50,7 @@ const sdk = new CMS({
|
|
|
50
50
|
### Class-based usage (throws on error)
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
|
-
import { CMS } from "@
|
|
53
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
54
54
|
|
|
55
55
|
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
56
56
|
|
|
@@ -66,7 +66,7 @@ console.log("Lead response:", leadResponse);
|
|
|
66
66
|
### Functional helper (Result pattern)
|
|
67
67
|
|
|
68
68
|
```ts
|
|
69
|
-
import { CMS, trackLead } from "@
|
|
69
|
+
import { CMS, trackLead } from "@vigneshreddy/cms-sdk";
|
|
70
70
|
|
|
71
71
|
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
72
72
|
|
|
@@ -88,7 +88,7 @@ if (res.ok) {
|
|
|
88
88
|
### Class-based usage (throws on error)
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
|
-
import { CMS } from "@
|
|
91
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
92
92
|
|
|
93
93
|
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
94
94
|
|
|
@@ -150,7 +150,7 @@ export interface CMSConfig {
|
|
|
150
150
|
You can override retries and timeout on a single request.
|
|
151
151
|
|
|
152
152
|
```ts
|
|
153
|
-
import { CMS } from "@
|
|
153
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
154
154
|
|
|
155
155
|
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
156
156
|
|
|
@@ -172,7 +172,7 @@ await sdk.trackLead(
|
|
|
172
172
|
All thrown errors from class-based methods are normalized as `CMSAPIError` or its specific subclasses.
|
|
173
173
|
|
|
174
174
|
```ts
|
|
175
|
-
import { CMS, CMSAPIError } from "@
|
|
175
|
+
import { CMS, CMSAPIError } from "@vigneshreddy/cms-sdk";
|
|
176
176
|
|
|
177
177
|
const sdk = new CMS({ apiKey: "sk_live_123" });
|
|
178
178
|
|
|
@@ -198,10 +198,10 @@ try {
|
|
|
198
198
|
## Exports
|
|
199
199
|
|
|
200
200
|
```ts
|
|
201
|
-
import { CMS } from "@
|
|
202
|
-
import { trackLead, trackSale } from "@
|
|
203
|
-
import { CMSAPIError } from "@
|
|
204
|
-
import type { TrackLeadRequest, TrackSaleRequest, TrackResponse } from "@
|
|
201
|
+
import { CMS } from "@vigneshreddy/cms-sdk";
|
|
202
|
+
import { trackLead, trackSale } from "@vigneshreddy/cms-sdk";
|
|
203
|
+
import { CMSAPIError } from "@vigneshreddy/cms-sdk";
|
|
204
|
+
import type { TrackLeadRequest, TrackSaleRequest, TrackResponse } from "@vigneshreddy/cms-sdk";
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
## Security
|