zubbl-sdk 1.0.8 → 1.1.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.
@@ -22,13 +22,19 @@ 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
+ // FIXED ROUTE:
32
+ const response = await axios.post(
33
+ "https://api.zubbl.com/sdk/identify",
34
+ { email, name },
35
+ { headers }
36
+ );
37
+
32
38
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
33
39
  return response.data;
34
40
  } catch (err) {
@@ -44,13 +50,17 @@ async function getTiles({ external_user_id }) {
44
50
  if (!external_user_id) throw new Error("external_user_id is required");
45
51
 
46
52
  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
- });
53
+ const headers = {
54
+ "x-api-key": config.apiKey,
55
+ "x-tenant-id": config.tenantId,
56
+ "x-app-id": config.appId
57
+ };
58
+
59
+ const response = await axios.get(
60
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
61
+ { headers }
62
+ );
63
+
54
64
  console.log("[ZUBBL SDK] getTiles response:", response.data);
55
65
  return response.data;
56
66
  } catch (err) {
@@ -20,13 +20,19 @@ 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
+ // FIXED ROUTE:
30
+ const response = await axios.post(
31
+ "https://api.zubbl.com/sdk/identify",
32
+ { email, name },
33
+ { headers }
34
+ );
35
+
30
36
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
31
37
  return response.data;
32
38
  } catch (err) {
@@ -42,13 +48,17 @@ async function getTiles({ external_user_id }) {
42
48
  if (!external_user_id) throw new Error("external_user_id is required");
43
49
 
44
50
  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
- });
51
+ const headers = {
52
+ "x-api-key": config.apiKey,
53
+ "x-tenant-id": config.tenantId,
54
+ "x-app-id": config.appId
55
+ };
56
+
57
+ const response = await axios.get(
58
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
59
+ { headers }
60
+ );
61
+
52
62
  console.log("[ZUBBL SDK] getTiles response:", response.data);
53
63
  return response.data;
54
64
  } catch (err) {
@@ -24,13 +24,19 @@
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
+ // FIXED ROUTE:
34
+ const response = await axios.post(
35
+ "https://api.zubbl.com/sdk/identify",
36
+ { email, name },
37
+ { headers }
38
+ );
39
+
34
40
  console.log("[ZUBBL SDK] identifyUser response:", response.data);
35
41
  return response.data;
36
42
  } catch (err) {
@@ -46,13 +52,17 @@
46
52
  if (!external_user_id) throw new Error("external_user_id is required");
47
53
 
48
54
  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
- });
55
+ const headers = {
56
+ "x-api-key": config.apiKey,
57
+ "x-tenant-id": config.tenantId,
58
+ "x-app-id": config.appId
59
+ };
60
+
61
+ const response = await axios.get(
62
+ `https://api.zubbl.com/sdk/external-users/${external_user_id}/tiles`,
63
+ { headers }
64
+ );
65
+
56
66
  console.log("[ZUBBL SDK] getTiles response:", response.data);
57
67
  return response.data;
58
68
  } 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.1.0",
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",