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