@marteye/studiojs 1.1.48-beta.1 → 1.1.49-beta.0

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 CHANGED
@@ -1,130 +1,52 @@
1
- # MartEye Studio JavaScript SDK (`@marteye/studiojs`)
1
+ # MartEye Studio JavaScript SDK (@marteye/studiojs)
2
2
 
3
- JavaScript/TypeScript SDK for the MartEye Studio API.
3
+ This library is a JavaScript SDK that allows you to easily integrate with MartEye Studio's API. It provides methods to interact with various resources, manage data, and leverage the powerful features offered by MartEye Studio.
4
4
 
5
5
  ## Installation
6
6
 
7
- ```bash
8
- npm install @marteye/studiojs
9
- ```
7
+ You can install the library using npm or yarn:
10
8
 
11
- For the beta release channel:
9
+ Using npm:
12
10
 
13
11
  ```bash
14
- npm install @marteye/studiojs@beta
15
- ```
16
-
17
- ## Create a client
18
-
19
- ```ts
20
- import Studio from "@marteye/studiojs";
21
-
22
- const studio = Studio({
23
- apiKey: process.env.STUDIO_API_KEY!,
24
- baseUrl: "https://app.marteyestudio.com/api", // optional
25
- defaultTimeout: 30000, // optional
26
- debug: false, // optional
27
- });
12
+ npm install @marteye/studiojs
28
13
  ```
29
14
 
30
- ## Basic usage
31
-
32
- ```ts
33
- const market = await studio.markets.get("greenfields");
34
- console.log(market.name);
15
+ Using yarn:
35
16
 
36
- const sales = await studio.sales.list("greenfields", {
37
- start: "2026-01-01",
38
- end: "2026-12-31",
39
- });
40
-
41
- console.log(sales.sales.length);
17
+ ```bash
18
+ yarn add @marteye/studiojs
42
19
  ```
43
20
 
44
- ## Messaging
21
+ ## Usage
45
22
 
46
- StudioJS now exposes a single messaging interface:
23
+ ### Importing the Library
47
24
 
48
- - `studio.broadcast.send(...)`
49
- - `studio.broadcast.get(...)`
25
+ Using ES Modules:
50
26
 
51
- Messaging is unified by:
52
-
53
- - `type`: `"sms" | "email"`
54
- - `kind`: `"broadcast" | "statement"`
55
-
56
- ### Send an SMS broadcast
57
-
58
- ```ts
59
- await studio.broadcast.send("greenfields", {
60
- type: "sms",
61
- kind: "broadcast",
62
- message: "Sale starts at 7pm",
63
- recipients: [
64
- {
65
- customerId: "customer-1",
66
- phoneNumbers: ["+447911123456"],
67
- },
68
- ],
69
- });
70
- ```
71
-
72
- ### Send a statement email
73
-
74
- ```ts
75
- await studio.broadcast.send("greenfields", {
76
- type: "email",
77
- kind: "statement",
78
- message: "Dear {{customerName}}, your balance is {{balance}}.",
79
- recipients: [
80
- {
81
- customerId: "customer-1",
82
- emails: ["buyer@example.com"],
83
- },
84
- ],
85
- });
27
+ ```javascript
28
+ import StudioJS from "@marteye/studiojs";
86
29
  ```
87
30
 
88
- ### Get task status
31
+ Or using CommonJS:
89
32
 
90
- ```ts
91
- const task = await studio.broadcast.get("greenfields", "sms", "task-id");
92
- console.log(task.status);
33
+ ```javascript
34
+ let StudioJS = require("@marteye/studiojs");
93
35
  ```
94
36
 
95
- ## Migration note
37
+ ### Initializing the SDK
96
38
 
97
- `studio.sms` has been removed in favour of `studio.broadcast`.
39
+ Before using the library, initialize it with your API key. For more information on obtaining an API key, please contact your MartEye representative.
98
40
 
99
- ### Before
100
-
101
- ```ts
102
- await studio.sms.sendSMS(marketId, payload);
103
- await studio.sms.getSMS(marketId, smsId);
104
- ```
105
-
106
- ### After
107
-
108
- ```ts
109
- await studio.broadcast.send(marketId, {
110
- type: "sms",
111
- kind: "broadcast",
112
- message: "Hello",
113
- recipients: [{ customerId: "c1", phoneNumbers: ["+447911123456"] }],
41
+ ```javascript
42
+ let studioClient = StudioJS.init({
43
+ apiKey: "YOUR_API_KEY_HERE",
114
44
  });
115
-
116
- await studio.broadcast.get(marketId, "sms", taskId);
117
45
  ```
118
46
 
119
- ## Types
120
-
121
- Relevant exported types include:
47
+ ## Contributing
122
48
 
123
- - `BroadcastPayload`
124
- - `BroadcastSendResponse`
125
- - `BroadcastTask`
126
- - `SMSTask`
127
- - `EmailTask`
49
+ Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.
128
50
 
129
51
  ## License
130
52
 
@@ -9,3 +9,4 @@ export type { ChunkedFile, MediaUploadOptions, FileInput, ChunkedInput };
9
9
  import * as StudioTypes from "./types";
10
10
  export { StudioTypes };
11
11
  export * from "./createApp";
12
+ export * from "./media-crate-client";