crexperium-sdk 1.1.1 → 1.2.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/dist/index.mjs CHANGED
@@ -130,22 +130,17 @@ class NetworkError extends CRMError {
130
130
  const isBrowser$1 = typeof window !== 'undefined';
131
131
  // Get fetch implementation
132
132
  function getFetch() {
133
+ // Browser environment
133
134
  if (isBrowser$1 && typeof window.fetch !== 'undefined') {
134
135
  return window.fetch.bind(window);
135
136
  }
136
- // In Node.js, use global fetch if available (Node 18+) or require node-fetch
137
+ // Node.js 18+ with native fetch
137
138
  if (typeof globalThis.fetch !== 'undefined') {
138
139
  return globalThis.fetch.bind(globalThis);
139
140
  }
140
- // Fallback to require node-fetch for older Node.js versions
141
- try {
142
- // eslint-disable-next-line @typescript-eslint/no-var-requires
143
- const nodeFetch = require('node-fetch');
144
- return nodeFetch.default || nodeFetch;
145
- }
146
- catch {
147
- throw new Error('Fetch is not available. Please upgrade to Node.js 18+ or install node-fetch.');
148
- }
141
+ // Node.js <18 without fetch - throw helpful error
142
+ throw new Error('Fetch is not available. Please upgrade to Node.js 18+ which includes native fetch support. ' +
143
+ 'Alternatively, install and configure a polyfill.');
149
144
  }
150
145
  class HTTPClient {
151
146
  constructor(config) {