@skippr/live-agent-sdk 0.17.0 → 0.18.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.
@@ -49,6 +49,7 @@ function useAuth({ appKey }) {
49
49
  setIsValidating(true);
50
50
  try {
51
51
  const res = await fetch(`${API_URL}/v1/auth/validate-token`, {
52
+ credentials: "omit",
52
53
  headers: { Authorization: `Bearer ${stored}` }
53
54
  });
54
55
  if (res.ok) {
@@ -80,6 +81,7 @@ function useAuth({ appKey }) {
80
81
  try {
81
82
  const resp = await fetch(`${API_URL}/v1/auth/request-otp`, {
82
83
  method: "POST",
84
+ credentials: "omit",
83
85
  headers: {
84
86
  "Content-Type": "application/json",
85
87
  "X-App-Key": appKey
@@ -106,6 +108,7 @@ function useAuth({ appKey }) {
106
108
  try {
107
109
  const resp = await fetch(`${API_URL}/v1/auth/verify-otp`, {
108
110
  method: "POST",
111
+ credentials: "omit",
109
112
  headers: {
110
113
  "Content-Type": "application/json",
111
114
  "X-App-Key": appKey
@@ -150,6 +153,7 @@ var API_URL2 = "https://skipprapi-production.up.railway.app";
150
153
  async function exchangeForBearerToken(appKey, userToken) {
151
154
  const resp = await fetch(`${API_URL2}/v1/auth/token-exchange`, {
152
155
  method: "POST",
156
+ credentials: "omit",
153
157
  headers: {
154
158
  "X-App-Key": appKey,
155
159
  "X-User-Token": userToken
@@ -198,6 +202,7 @@ function useSession({ agentId, authToken, appKey, userToken }) {
198
202
  try {
199
203
  const createResp = await fetch(`${API_URL2}/v1/sessions`, {
200
204
  method: "POST",
205
+ credentials: "omit",
201
206
  headers: { "Content-Type": "application/json", ...headers },
202
207
  body: JSON.stringify({ agentId })
203
208
  });
@@ -207,6 +212,7 @@ function useSession({ agentId, authToken, appKey, userToken }) {
207
212
  const { session } = await createResp.json();
208
213
  const startResp = await fetch(`${API_URL2}/v1/sessions/${session.id}/start`, {
209
214
  method: "POST",
215
+ credentials: "omit",
210
216
  headers
211
217
  });
212
218
  if (!startResp.ok) {
@@ -230,6 +236,7 @@ function useSession({ agentId, authToken, appKey, userToken }) {
230
236
  try {
231
237
  await fetch(`${API_URL2}/v1/sessions/${sessionId}/complete`, {
232
238
  method: "POST",
239
+ credentials: "omit",
233
240
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${bearerToken}` },
234
241
  body: JSON.stringify({})
235
242
  });