zubbl-sdk 1.0.8 → 1.0.9

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.
@@ -22,13 +22,18 @@ async function identifyUser({ email, name }) {
22
22
  if (!email) throw new Error("email is required");
23
23
 
24
24
  try {
25
- const response = await axios.post("https://api.zubbl.com/sdk/identify", { email, name }, {
26
- headers: {
27
- "x-api-key": config.apiKey,
28
- "x-tenant-id": config.tenantId,
29
- "x-app-id": config.appId
30
- }
31
- });
25
+ const headers = {
26
+ "x-api-key": config.apiKey,
27
+ "x-tenant-id": config.tenantId,
28
+ "x-app-id": config.appId
29
+ };
30
+
31
+ const response = await axios.post(
32
+ "https://api.zubbl.com/user/identify",
33
+ { email, name },
34
+ { headers }
35
+ );
36
+
32
37
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
33
38
  return response.data;
34
39
  } catch (err) {
@@ -44,13 +49,17 @@ async function getTiles({ external_user_id }) {
44
49
  if (!external_user_id) throw new Error("external_user_id is required");
45
50
 
46
51
  try {
47
- const response = await axios.get(`https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`, {
48
- headers: {
49
- "x-api-key": config.apiKey,
50
- "x-tenant-id": config.tenantId,
51
- "x-app-id": config.appId
52
- }
53
- });
52
+ const headers = {
53
+ "x-api-key": config.apiKey,
54
+ "x-tenant-id": config.tenantId,
55
+ "x-app-id": config.appId
56
+ };
57
+
58
+ const response = await axios.get(
59
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
60
+ { headers }
61
+ );
62
+
54
63
  console.log("[ZUBBL SDK] getTiles response:", response.data);
55
64
  return response.data;
56
65
  } catch (err) {
@@ -20,13 +20,18 @@ async function identifyUser({ email, name }) {
20
20
  if (!email) throw new Error("email is required");
21
21
 
22
22
  try {
23
- const response = await axios.post("https://api.zubbl.com/sdk/identify", { email, name }, {
24
- headers: {
25
- "x-api-key": config.apiKey,
26
- "x-tenant-id": config.tenantId,
27
- "x-app-id": config.appId
28
- }
29
- });
23
+ const headers = {
24
+ "x-api-key": config.apiKey,
25
+ "x-tenant-id": config.tenantId,
26
+ "x-app-id": config.appId
27
+ };
28
+
29
+ const response = await axios.post(
30
+ "https://api.zubbl.com/user/identify",
31
+ { email, name },
32
+ { headers }
33
+ );
34
+
30
35
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
31
36
  return response.data;
32
37
  } catch (err) {
@@ -42,13 +47,17 @@ async function getTiles({ external_user_id }) {
42
47
  if (!external_user_id) throw new Error("external_user_id is required");
43
48
 
44
49
  try {
45
- const response = await axios.get(`https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`, {
46
- headers: {
47
- "x-api-key": config.apiKey,
48
- "x-tenant-id": config.tenantId,
49
- "x-app-id": config.appId
50
- }
51
- });
50
+ const headers = {
51
+ "x-api-key": config.apiKey,
52
+ "x-tenant-id": config.tenantId,
53
+ "x-app-id": config.appId
54
+ };
55
+
56
+ const response = await axios.get(
57
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
58
+ { headers }
59
+ );
60
+
52
61
  console.log("[ZUBBL SDK] getTiles response:", response.data);
53
62
  return response.data;
54
63
  } catch (err) {
@@ -24,13 +24,18 @@
24
24
  if (!email) throw new Error("email is required");
25
25
 
26
26
  try {
27
- const response = await axios.post("https://api.zubbl.com/sdk/identify", { email, name }, {
28
- headers: {
29
- "x-api-key": config.apiKey,
30
- "x-tenant-id": config.tenantId,
31
- "x-app-id": config.appId
32
- }
33
- });
27
+ const headers = {
28
+ "x-api-key": config.apiKey,
29
+ "x-tenant-id": config.tenantId,
30
+ "x-app-id": config.appId
31
+ };
32
+
33
+ const response = await axios.post(
34
+ "https://api.zubbl.com/user/identify",
35
+ { email, name },
36
+ { headers }
37
+ );
38
+
34
39
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
35
40
  return response.data;
36
41
  } catch (err) {
@@ -46,13 +51,17 @@
46
51
  if (!external_user_id) throw new Error("external_user_id is required");
47
52
 
48
53
  try {
49
- const response = await axios.get(`https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`, {
50
- headers: {
51
- "x-api-key": config.apiKey,
52
- "x-tenant-id": config.tenantId,
53
- "x-app-id": config.appId
54
- }
55
- });
54
+ const headers = {
55
+ "x-api-key": config.apiKey,
56
+ "x-tenant-id": config.tenantId,
57
+ "x-app-id": config.appId
58
+ };
59
+
60
+ const response = await axios.get(
61
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
62
+ { headers }
63
+ );
64
+
56
65
  console.log("[ZUBBL SDK] getTiles response:", response.data);
57
66
  return response.data;
58
67
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zubbl-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Zubbl SDK for secure policy enforcement (browser, Node, universal)",
5
5
  "main": "dist/zubbl-sdk.cjs.js",
6
6
  "module": "dist/zubbl-sdk.esm.js",