@insignia-education/api-sdk-js 0.15.103 → 0.15.104

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Client.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.103",
3
+ "version": "0.15.104",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/Client.js CHANGED
@@ -11,6 +11,16 @@ export default class InsigniaClient {
11
11
  return this.#baseUrl;
12
12
  }
13
13
 
14
+ /** Node only — reads back a cookie captured from a prior response (e.g. to persist a session's JWT). */
15
+ getCookie(name) {
16
+ return this.#cookies.get(name) ?? null;
17
+ }
18
+
19
+ /** Node only — seeds a cookie onto this client (e.g. to rehydrate a session captured earlier) so it's sent on subsequent requests. */
20
+ setCookie(name, value) {
21
+ this.#cookies.set(name, value);
22
+ }
23
+
14
24
  static _resolve(baseUrl) {
15
25
  const envBaseUrl = typeof process !== 'undefined'
16
26
  ? process.env?.INSIGNIA_EDUCATION_API_BASE_URL ?? null