### Install or link the repository Source: https://github.com/steel-dev/steel-node/blob/main/CONTRIBUTING.md Methods for installing the SDK from git or linking a local clone for development. ```sh $ npm install git+ssh://git@github.com:steel-dev/steel-node.git ``` ```sh # Clone $ git clone https://www.github.com/steel-dev/steel-node $ cd steel-node # With yarn $ yarn link $ cd ../my-package $ yarn link steel-sdk # With pnpm $ pnpm link --global $ cd ../my-package $ pnpm link --global steel-sdk ``` -------------------------------- ### Create and execute examples Source: https://github.com/steel-dev/steel-node/blob/main/CONTRIBUTING.md Define a new example file and run it using the project's TypeScript runner. ```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T ``` ```sh $ chmod +x examples/.ts # run the example against your api $ yarn tsn -T examples/.ts ``` -------------------------------- ### Install Steel SDK Source: https://github.com/steel-dev/steel-node/blob/main/README.md Install the steel-sdk package using npm. ```sh npm install steel-sdk ``` -------------------------------- ### Retrieve Session Details Example Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md Example request for fetching details of a specific session by ID. ```http GET /v1/sessions/sess_abc123 ``` -------------------------------- ### Run tests Source: https://github.com/steel-dev/steel-node/blob/main/CONTRIBUTING.md Start the mock server and execute the test suite. ```sh $ ./scripts/mock ``` ```sh $ yarn run test ``` -------------------------------- ### Initialize the development environment Source: https://github.com/steel-dev/steel-node/blob/main/CONTRIBUTING.md Install dependencies and build the project using yarn. ```sh $ yarn $ yarn build ``` -------------------------------- ### GET /v1/files Source: https://github.com/steel-dev/steel-node/blob/main/api.md List all files. ```APIDOC ## GET /v1/files ### Description List all files. ### Method GET ### Endpoint /v1/files ### Response #### Success Response (200) - **Fileslist** (object) - A list of files. ``` -------------------------------- ### GET /v1/extensions Source: https://github.com/steel-dev/steel-node/blob/main/api.md Lists all available extensions. ```APIDOC ## GET /v1/extensions ### Description Retrieves a list of all extensions. ### Method GET ### Endpoint /v1/extensions ``` -------------------------------- ### GET /v1/credentials Source: https://github.com/steel-dev/steel-node/blob/main/api.md Lists all credentials. ```APIDOC ## GET /v1/credentials ### Description Retrieves a list of credentials. ### Method GET ### Endpoint /v1/credentials ``` -------------------------------- ### GET /v1/profiles Source: https://github.com/steel-dev/steel-node/blob/main/api.md Lists profiles. ```APIDOC ## GET /v1/profiles ### Description Retrieves a list of profiles based on the provided parameters. ### Method GET ### Endpoint /v1/profiles ``` -------------------------------- ### GET /v1/sessions/:id/live-details Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md Get the current live state of a session, including pages and tabs. ```APIDOC ## GET /v1/sessions/:id/live-details ### Description Get current live state of session (pages, tabs, browser state). ### Method GET ### Endpoint /v1/sessions/:id/live-details ### Parameters #### Path Parameters - **id** (string) - Required - Session ID ``` -------------------------------- ### GET /v1/files/{path} Source: https://github.com/steel-dev/steel-node/blob/main/api.md Download a specific file by path. ```APIDOC ## GET /v1/files/{path} ### Description Download a specific file by path. ### Method GET ### Endpoint /v1/files/{path} ### Parameters #### Path Parameters - **path** (string) - Required - The path of the file to download. ### Response #### Success Response (200) - **Response** (object) - The file content. ``` -------------------------------- ### GET /v1/sessions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md List all sessions with support for filtering and pagination. ```APIDOC ## GET /v1/sessions ### Description List all sessions with pagination. ### Method GET ### Endpoint /v1/sessions ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by status (live, released, failed) - **projectId** (string) - Optional - Filter by project - **cursorId** (string) - Optional - Cursor for pagination - **limit** (number) - Optional - Results per page ``` -------------------------------- ### Handle InternalServerError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching an InternalServerError. ```typescript try { await client.sessions.create(); } catch (err) { if (err instanceof Steel.InternalServerError) { console.log('Server error; the request may be retried'); } } ``` -------------------------------- ### GET /v1/extensions/{extensionId} Source: https://github.com/steel-dev/steel-node/blob/main/api.md Downloads a specific extension by its ID. ```APIDOC ## GET /v1/extensions/{extensionId} ### Description Downloads the content of the extension identified by extensionId. ### Method GET ### Endpoint /v1/extensions/{extensionId} ### Parameters #### Path Parameters - **extensionId** (string) - Required - The unique identifier of the extension. ``` -------------------------------- ### GET /v1/sessions/{id} Source: https://github.com/steel-dev/steel-node/blob/main/api.md Retrieve session details by ID. ```APIDOC ## GET /v1/sessions/{id} ### Description Retrieve session details by ID. ### Method GET ### Endpoint /v1/sessions/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. ### Response #### Success Response (200) - **Session** (object) - The session details. ``` -------------------------------- ### GET /v1/profiles/{id} Source: https://github.com/steel-dev/steel-node/blob/main/api.md Retrieves a specific profile by ID. ```APIDOC ## GET /v1/profiles/{id} ### Description Retrieves the details of a profile by its ID. ### Method GET ### Endpoint /v1/profiles/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the profile. ``` -------------------------------- ### Get Session Live Details Response Schema Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md The response structure containing the current live state of a session. ```typescript { pages: object[], tabs: object[], activePageId?: string, activeTabId?: string } ``` -------------------------------- ### Handle RateLimitError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching a RateLimitError when exceeding request limits. ```typescript try { for (let i = 0; i < 100; i++) { await client.sessions.create(); } } catch (err) { if (err instanceof Steel.RateLimitError) { console.log('Rate limit exceeded; try again later'); } } ``` -------------------------------- ### status(sessionId, options?) Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/SessionCaptchas.md Gets the current CAPTCHA status for a session. ```APIDOC ## status(sessionId: string, options?: Core.RequestOptions) ### Description Gets the current CAPTCHA status for a session. ### Parameters - **sessionId** (string) - Required - Session ID - **options** (Core.RequestOptions) - Optional - Request options ### Returns - **Core.APIPromise** - Promise resolving to array of CAPTCHA status items. ``` -------------------------------- ### Handle ConflictError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching a ConflictError when attempting to create a resource that already exists. ```typescript try { await client.credentials.create({ origin: 'https://example.com', // ... }); await client.credentials.create({ origin: 'https://example.com', // Same origin // ... }); } catch (err) { if (err instanceof Steel.ConflictError) { console.log('Credential for this origin already exists'); } } ``` -------------------------------- ### GET /v1/sessions/:sessionId/captchas/status Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md Get CAPTCHA status for session. ```APIDOC ## GET /v1/sessions/:sessionId/captchas/status ### Description Get CAPTCHA status for session. ### Method GET ### Endpoint /v1/sessions/:sessionId/captchas/status ### Parameters #### Path Parameters - **sessionId** (string) - Required ``` -------------------------------- ### Initialize and use the Steel client Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Demonstrates initializing the client using environment variables or explicit configuration, followed by creating a session. ```typescript import Steel from 'steel-sdk'; // Initialize with environment variable const client = new Steel(); // Initialize with explicit options const client = new Steel({ steelAPIKey: 'sk_live_...', baseURL: 'https://api.steel.dev', timeout: 30000, maxRetries: 3, }); // Create a session const session = await client.sessions.create({ timeout: 20000 }); console.log(session.id); ``` -------------------------------- ### Initialize and use Steel SDK Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Demonstrates client initialization, session creation, command execution, scraping, and session release. ```typescript import Steel from 'steel-sdk'; const client = new Steel({ steelAPIKey: process.env.STEEL_API_KEY, }); // Create a browser session const session = await client.sessions.create({ timeout: 20000, useProxy: true, dimensions: { width: 1920, height: 1080 }, }); // Execute commands const result = await client.sessions.computer(session.id, { action: 'click', xpath: '//button[@id="submit"]', }); // Scrape content const scrape = await client.scrape({ url: 'https://example.com', format: ['html', 'markdown'], }); // Release session await client.sessions.release(session.id); ``` -------------------------------- ### constructor(options?: ClientOptions) Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Initializes a new instance of the Steel client to interact with the Steel API. ```APIDOC ## constructor(options?: ClientOptions) ### Description Initializes a new instance of the Steel client. This client provides access to all available API resources. ### Parameters - **steelAPIKey** (string | null) - Optional - The API key required to authenticate requests. Defaults to process.env['STEEL_API_KEY']. - **baseURL** (string) - Optional - Override the default base URL for the API. Defaults to https://api.steel.dev. - **timeout** (number) - Optional - Maximum time in milliseconds to wait for a response. Defaults to 60000. - **httpAgent** (Agent) - Optional - HTTP agent for connection management. - **fetch** (Core.Fetch) - Optional - Custom fetch function implementation. - **maxRetries** (number) - Optional - Maximum number of request retries on temporary failures. Defaults to 2. - **defaultHeaders** (Core.Headers) - Optional - Default headers to include with every request. - **defaultQuery** (Core.DefaultQuery) - Optional - Default query parameters to include with every request. ### Example ```typescript import Steel from 'steel-sdk'; const client = new Steel({ steelAPIKey: 'sk_live_...', baseURL: 'https://api.steel.dev', timeout: 30000, maxRetries: 3, }); ``` ``` -------------------------------- ### ClientOptions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Configuration options for initializing the Steel client. ```APIDOC ## ClientOptions ### Description Configuration options for the Steel client. ### Interface ```typescript interface ClientOptions { steelAPIKey?: string | null | undefined; baseURL?: string | null | undefined; timeout?: number | undefined; httpAgent?: Agent | undefined; fetch?: Core.Fetch | undefined; maxRetries?: number | undefined; defaultHeaders?: Core.Headers | undefined; defaultQuery?: Core.DefaultQuery | undefined; } ``` ``` -------------------------------- ### Initialize Steel Client with Constructor Options Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Configure the Steel client using the ClientOptions object during initialization. ```typescript import Steel from 'steel-sdk'; const client = new Steel({ steelAPIKey: 'sk_live_...', baseURL: 'https://api.steel.dev', timeout: 60000, maxRetries: 2, httpAgent: myAgent, fetch: myCustomFetch, defaultHeaders: { 'X-Custom-Header': 'value' }, defaultQuery: { version: 'v1' }, }); ``` -------------------------------- ### client.sessions.create Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Creates a new browser session with the provided configuration. ```APIDOC ## client.sessions.create(body?: SessionCreateParams, options?: Core.RequestOptions) ### Description Creates a new session with the provided configuration. ### Parameters - **body** (SessionCreateParams) - Optional - Session configuration parameters - **options** (Core.RequestOptions) - Optional - Request options (timeout, maxRetries, etc.) ### Returns `Core.APIPromise` — Promise resolving to created session object. ### Throws - `BadRequestError` — Invalid session configuration - `RateLimitError` — Rate limit exceeded - `InternalServerError` — Server error during creation ``` -------------------------------- ### Configure Device and Browser Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Define device type and user agent for the session. ```typescript const session = await client.sessions.create({ deviceConfig: { device: 'mobile' | 'desktop', }, userAgent: 'Mozilla/5.0 ...', }); ``` -------------------------------- ### client.profiles.create Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Profiles.md Creates a new browser profile with optional extensions, fingerprint, and dimension configurations. ```APIDOC ## client.profiles.create ### Description Creates a new browser profile with optional extensions, fingerprint, and dimension configurations. ### Parameters - **body** (ProfileCreateParams) - Required - Profile configuration - **options** (Core.RequestOptions) - Optional - Request options ### Returns Promise resolving to ProfileCreateResponse containing created profile metadata. ### Example ```typescript const profile = await client.profiles.create({ extensionIds: ['ext_123', 'ext_456'], dimensions: { width: 1920, height: 1080, }, userAgent: 'Mozilla/5.0...', projectId: 'proj_abc', }); ``` ``` -------------------------------- ### Create a browser profile Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Profiles.md Initializes a new profile with specific extensions, dimensions, and user agent settings. ```typescript const profile = await client.profiles.create({ extensionIds: ['ext_123', 'ext_456'], dimensions: { width: 1920, height: 1080, }, userAgent: 'Mozilla/5.0...', projectId: 'proj_abc', }); console.log(profile.id); console.log(profile.status); // 'UPLOADING', 'READY', or 'FAILED' ``` -------------------------------- ### Create a New Session Source: https://github.com/steel-dev/steel-node/blob/main/README.md Instantiate the Steel client and create a new session with custom timeout and proxy settings. ```js import Steel from 'steel-sdk'; const client = new Steel(); const session = await client.sessions.create({ timeout: 20000, useProxy: true }); console.log(session.id); ``` -------------------------------- ### Handle APIUserAbortError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching an APIUserAbortError when using an AbortController. ```typescript const controller = new AbortController(); setTimeout(() => controller.abort(), 5000); try { await client.sessions.create({}, { signal: controller.signal }); } catch (err) { if (err instanceof Steel.APIUserAbortError) { console.log('Request was aborted'); } } ``` -------------------------------- ### Steel Constructor Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Initializes the Steel SDK client with configuration options for authentication, networking, and default request parameters. ```APIDOC ## Steel Constructor ### Description Initializes a new instance of the Steel SDK client. This constructor accepts a configuration object to define authentication credentials and global request behavior. ### Parameters - **steelAPIKey** (string | null) - Optional - API key for authentication. Defaults to process.env['STEEL_API_KEY']. - **baseURL** (string) - Optional - API base URL. Defaults to https://api.steel.dev. - **timeout** (number) - Optional - Request timeout in milliseconds. Defaults to 60000. - **maxRetries** (number) - Optional - Maximum retry attempts for transient errors. Defaults to 2. - **httpAgent** (Agent) - Optional - HTTP(S) agent for connection management. - **fetch** (Fetch) - Optional - Custom fetch implementation. - **defaultHeaders** (Headers) - Optional - Headers included in all requests. - **defaultQuery** (DefaultQuery) - Optional - Query parameters included in all requests. ### Example ```typescript import Steel from 'steel-sdk'; const client = new Steel({ steelAPIKey: 'sk_live_...', baseURL: 'https://api.steel.dev', timeout: 60000, maxRetries: 2, defaultHeaders: { 'X-Custom-Header': 'value' }, defaultQuery: { version: 'v1' }, }); ``` ``` -------------------------------- ### Handle APIConnectionError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching an APIConnectionError and accessing the underlying cause. ```typescript try { const client = new Steel({ baseURL: 'https://unreachable-server.local' }); await client.sessions.create(); } catch (err) { if (err instanceof Steel.APIConnectionError) { console.log(`Connection failed: ${err.message}`); if (err.cause) { console.log(`Underlying cause: ${err.cause.message}`); } } } ``` -------------------------------- ### POST /v1/sessions Source: https://github.com/steel-dev/steel-node/blob/main/api.md Create a new session. ```APIDOC ## POST /v1/sessions ### Description Create a new session. ### Method POST ### Endpoint /v1/sessions ### Response #### Success Response (200) - **Session** (object) - The created session. ``` -------------------------------- ### Manage Profiles Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Use existing profiles and configure persistence. ```typescript const session = await client.sessions.create({ profileId: 'prof_xyz', // Use existing profile persistProfile: true, // Persist profile after session }); ``` -------------------------------- ### Upload Files with Steel SDK Source: https://github.com/steel-dev/steel-node/blob/main/README.md Demonstrates various methods for uploading files, including fs.ReadStream, File API, fetch Response, and the toFile helper. ```ts import fs from 'fs'; import fetch from 'node-fetch'; import Steel, { toFile } from 'steel-sdk'; const client = new Steel(); // If you have access to Node `fs` we recommend using `fs.createReadStream()`: await client.files.upload({ file: fs.createReadStream('/path/to/file') }); // Or if you have the web `File` API you can pass a `File` instance: await client.files.upload({ file: new File(['my bytes'], 'file') }); // You can also pass a `fetch` `Response`: await client.files.upload({ file: await fetch('https://somesite/file') }); // Finally, if none of the above are convenient, you can use our `toFile` helper: await client.files.upload({ file: await toFile(Buffer.from('my bytes'), 'file') }); await client.files.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') }); ``` -------------------------------- ### Handle APIConnectionTimeoutError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching a timeout error with a custom timeout duration. ```typescript try { await client.sessions.create({ timeout: 5000, // 5 second timeout }); } catch (err) { if (err instanceof Steel.APIConnectionTimeoutError) { console.log('Request timed out after 5 seconds'); } } ``` -------------------------------- ### download() Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Files.md Downloads a file from global storage and returns the raw Response object. ```APIDOC ## download(path_: string, options?: Core.RequestOptions) ### Description Downloads a file from global storage. Returns the raw Response object. ### Parameters - **path_** (string) - Required - File path in storage system - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` — Promise resolving to Response object with binary data. ### Throws - `NotFoundError` — File not found ``` -------------------------------- ### Configure Proxy Settings Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set up standard, regional, or custom proxy configurations. ```typescript // Use Steel proxies const session = await client.sessions.create({ useProxy: true, }); // Use regional proxy const session = await client.sessions.create({ useProxy: { geolocation: 'US', }, }); // Use custom proxy const session = await client.sessions.create({ proxyUrl: 'http://user:pass@proxy.example.com:8080', }); ``` -------------------------------- ### Handle UnprocessableEntityError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Example of catching an UnprocessableEntityError due to invalid input data. ```typescript try { await client.sessions.create({ region: 'invalid_region', // Invalid region code }); } catch (err) { if (err instanceof Steel.UnprocessableEntityError) { console.log('Invalid region specified'); } } ``` -------------------------------- ### GET /v1/sessions/:id/context Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md Retrieve the context of a session, including cookies and storage data. ```APIDOC ## GET /v1/sessions/:id/context ### Description Get session context (cookies, localStorage, indexedDB). ### Method GET ### Endpoint /v1/sessions/:id/context ### Parameters #### Path Parameters - **id** (string) - Required - Session ID ``` -------------------------------- ### Configure SDK to Use Web Fetch in Node.js Source: https://github.com/steel-dev/steel-node/blob/main/README.md Instruct the SDK to use a global web-standards-compliant `fetch` function instead of `node-fetch` in Node.js environments. This is useful when using experimental fetch features or environments like NextJS. ```typescript // Tell TypeScript and the package to use the global web fetch instead of node-fetch. // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. import 'steel-sdk/shims/web'; import Steel from 'steel-sdk'; ``` -------------------------------- ### POST /v1/profiles Source: https://github.com/steel-dev/steel-node/blob/main/api.md Creates a new profile. ```APIDOC ## POST /v1/profiles ### Description Creates a new profile with the provided parameters. ### Method POST ### Endpoint /v1/profiles ``` -------------------------------- ### Create a new session Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Initializes a session with specific timeout, proxy, and viewport configurations. ```typescript const session = await client.sessions.create({ timeout: 20000, useProxy: true, dimensions: { width: 1920, height: 1080 }, }); console.log(`Session ID: ${session.id}`); console.log(`Debug URL: ${session.debugUrl}`); ``` -------------------------------- ### Get Session Events Response Schema Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md The response structure containing recorded session events in RRWeb format. ```typescript { events: object[] } ``` -------------------------------- ### Create profile Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Access the profiles resource for managing browser profiles. ```typescript const profile = await client.profiles.create(profileData); ``` -------------------------------- ### Get CAPTCHA status Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/SessionCaptchas.md Retrieves the current status of CAPTCHAs for a specific session, including solving state and task counts. ```typescript const status = await client.sessions.captchas.status('sess_abc123'); for (const item of status) { console.log(`Page ${item.pageId}:`); console.log(` URL: ${item.url}`); console.log(` Solving: ${item.isSolvingCaptcha}`); console.log(` Tasks: ${item.tasks.length}`); } ``` -------------------------------- ### Use Undocumented Request Parameters Source: https://github.com/steel-dev/steel-node/blob/main/README.md Include undocumented parameters in requests by using `// @ts-expect-error` to bypass TypeScript checks. The SDK sends any extra values as-is, either in the query for GET requests or in the body for others. ```typescript client.foo.create({ foo: 'my_param', bar: 12, // @ts-expect-error baz is not yet public baz: 'undocumented option', }); ``` -------------------------------- ### client.sessions.computer Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Executes computer actions like mouse movements, clicks, keyboard input, and more. ```APIDOC ## client.sessions.computer(sessionId: string, body: SessionComputerParams, options?: Core.RequestOptions) ### Description Executes computer actions like mouse movements, clicks, keyboard input, and more. ### Parameters - **sessionId** (string) - Required - Session ID - **body** (SessionComputerParams) - Required - Computer action parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` — Promise resolving to action response. ``` -------------------------------- ### Configure API Key via Environment Variable Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set the API key using the STEEL_API_KEY environment variable, which the client reads automatically. ```bash export STEEL_API_KEY='sk_live_your_key_here' ``` ```typescript const client = new Steel(); // Automatically reads STEEL_API_KEY ``` -------------------------------- ### Optimize Performance Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Configure resource blocking to reduce bandwidth usage. ```typescript const session = await client.sessions.create({ optimizeBandwidth: { blockImages: true, blockMedia: true, blockStylesheets: false, blockHosts: ['analytics.google.com'], blockUrlPatterns: ['.*\\.tracking\\.com.*'], }, }); ``` -------------------------------- ### list() Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Files.md Lists all global files for the organization in descending order (most recent first). ```APIDOC ## list(options?: Core.RequestOptions) ### Description Lists all global files for the organization in descending order (most recent first). ### Parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` — Promise resolving to list of files. ``` -------------------------------- ### client.sessions.create Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/SessionCaptchas.md Configures CAPTCHA solving behavior during the creation of a new session. ```APIDOC ## client.sessions.create ### Description Creates a new session with optional CAPTCHA solving configurations. ### Parameters - **solveCaptcha** (boolean) - Optional - Enables automatic CAPTCHA solving. - **stealthConfig.autoCaptchaSolving** (boolean) - Optional - Alternative configuration for enabling automatic CAPTCHA solving. ### Request Example ```typescript const session = await client.sessions.create({ solveCaptcha: true, stealthConfig: { autoCaptchaSolving: true, }, }); ``` ``` -------------------------------- ### Provide a Custom Fetch Client for Logging Source: https://github.com/steel-dev/steel-node/blob/main/README.md Instantiate the Steel client with a custom `fetch` function to intercept and log requests and responses. This allows for inspection or modification of requests before they are sent and responses before they are processed. ```typescript import { fetch } from 'undici'; // as one example import Steel from 'steel-sdk'; const client = new Steel({ fetch: async (url: RequestInfo, init?: RequestInit): Promise => { console.log('About to make a request', url, init); const response = await fetch(url, init); console.log('Got response', response); return response; }, }); ``` -------------------------------- ### Project File Structure Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Displays the directory layout of the steel-node project. ```text /output ├── README.md (this file) ├── types.md (type definitions) ├── endpoints.md (HTTP endpoints) ├── errors.md (error classes) ├── configuration.md (setup options) └── api-reference/ ├── Steel.md (main client) ├── Sessions.md (session management) ├── Credentials.md (credentials) ├── Files.md (file storage) ├── Extensions.md (Chrome extensions) ├── Profiles.md (browser profiles) └── SessionCaptchas.md (CAPTCHA solving) ``` -------------------------------- ### POST /v1/credentials Source: https://github.com/steel-dev/steel-node/blob/main/api.md Creates a new credential. ```APIDOC ## POST /v1/credentials ### Description Creates a new credential record. ### Method POST ### Endpoint /v1/credentials ``` -------------------------------- ### client.sessions.list Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Lists sessions with support for cursor-based pagination. ```APIDOC ## client.sessions.list ### Description Retrieves a list of sessions, supporting auto-paginating iteration or manual cursor-based pagination. ### Parameters - **status** (string) - Optional - Filter sessions by status (e.g., 'live'). ``` -------------------------------- ### Authenticate with Steel API Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Initialize the Steel client using an API key provided directly or via the STEEL_API_KEY environment variable. ```typescript const client = new Steel({ steelAPIKey: 'sk_live_your_key_here', }); // Or via environment variable: STEEL_API_KEY ``` -------------------------------- ### Download an extension Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Downloads the content or URL of an extension by its ID. ```typescript const extensionContent = await client.extensions.download('ext_abc123'); ``` -------------------------------- ### upload() Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Files.md Uploads a file to global storage via multipart/form-data. Accepts binary data, streams, or a URL string. ```APIDOC ## upload(body: FileUploadParams, options?: Core.RequestOptions) ### Description Uploads a file to global storage via multipart/form-data. Accepts either binary data or a URL string to download from. ### Parameters - **body** (FileUploadParams) - Required - Upload parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` — Promise resolving to uploaded file metadata. ### Throws - `BadRequestError` — Invalid file format or parameters ``` -------------------------------- ### POST /v1/extensions Source: https://github.com/steel-dev/steel-node/blob/main/api.md Uploads a new extension. ```APIDOC ## POST /v1/extensions ### Description Uploads a new extension to the system. ### Method POST ### Endpoint /v1/extensions ``` -------------------------------- ### Configure Advanced Session Options Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set additional flags for ad blocking, CAPTCHA solving, and compatibility. ```typescript const session = await client.sessions.create({ blockAds: true, // Block ads solveCaptcha: true, // Enable CAPTCHA solving isSelenium: true, // Selenium compatibility inactivityTimeout: 120000, // 2 minute inactivity timeout concurrency: 5, // Create 5 sessions concurrently projectId: 'proj_123', // Assign to project sessionId: 'custom-uuid', // Custom session ID }); ``` -------------------------------- ### client.credentials.create Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Credentials.md Encrypts and stores credentials for a specified origin. ```APIDOC ## client.credentials.create ### Description Encrypts and stores credentials for an origin. ### Parameters - **body** (CredentialCreateParams) - Required - Credential data - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` - Promise resolving to credential metadata. ### Throws - `BadRequestError` - Invalid credential format - `AuthenticationError` - Authentication failed ``` -------------------------------- ### Configure Basic Session Parameters Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set fundamental session properties like timeout, headless mode, and dimensions. ```typescript const session = await client.sessions.create({ timeout: 20000, // Session timeout (ms) headless: false, // Run in headless mode fullscreen: true, // Launch in fullscreen dimensions: { width: 1920, height: 1080, }, }); ``` -------------------------------- ### solve() Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/SessionCaptchas.md Manually initiates the CAPTCHA solving process. ```APIDOC ## solve() ### Description Manually initiates the CAPTCHA solving process when automatic solving is disabled. ``` -------------------------------- ### Manage Browser Extensions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Load specific extensions or all uploaded extensions into the session. ```typescript const session = await client.sessions.create({ extensionIds: ['ext_123', 'ext_456'], }); // Or install all uploaded extensions const session = await client.sessions.create({ extensionIds: ['all_ext'], }); ``` -------------------------------- ### Select Fetch API Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Force specific fetch implementations by importing shims before the SDK. ```typescript import 'steel-sdk/shims/web'; import Steel from 'steel-sdk'; ``` ```typescript import 'steel-sdk/shims/node'; import Steel from 'steel-sdk'; ``` -------------------------------- ### List files Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Access the files resource for global file storage operations. ```typescript const files = await client.files.list(); ``` -------------------------------- ### Upload a Chrome extension Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Uploads a .zip or .crx file or a Chrome Web Store URL. Requires the fs module to create a read stream for local files. ```typescript import fs from 'fs'; const extension = await client.extensions.upload({ file: fs.createReadStream('/path/to/extension.zip'), extensionName: 'my-extension', }); console.log(extension.id); console.log(extension.name); console.log(extension.createdAt); ``` -------------------------------- ### client.credentials.list Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Credentials.md Fetches all credential metadata for the current organization. ```APIDOC ## client.credentials.list ### Description Fetches all credential metadata for the current organization. ### Parameters - **query** (CredentialListParams) - Optional - Query parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.APIPromise` - Promise resolving to list of credential metadata. ``` -------------------------------- ### POST /v1/files Source: https://github.com/steel-dev/steel-node/blob/main/api.md Upload a file. ```APIDOC ## POST /v1/files ### Description Upload a file. ### Method POST ### Endpoint /v1/files ### Response #### Success Response (200) - **File** (object) - The uploaded file details. ``` -------------------------------- ### Use TypeScript Session Type Source: https://github.com/steel-dev/steel-node/blob/main/README.md Instantiate the Steel client and create a new session, explicitly typing the session object using Steel.Session. ```ts import Steel from 'steel-sdk'; const client = new Steel(); const session: Steel.Session = await client.sessions.create(); ``` -------------------------------- ### client.extensions.list Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Lists all extensions associated with the organization. ```APIDOC ## list(options?: Core.RequestOptions) ### Description Lists all extensions for the organization. ### Parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns Core.APIPromise — Promise resolving to list of extensions. ``` -------------------------------- ### Download a file Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Files.md Downloads a file and returns the raw Response object for binary data handling. ```typescript const response = await client.files.download('documents/my-file.pdf'); const buffer = await response.arrayBuffer(); // Use buffer as needed ``` -------------------------------- ### Steel.toFile Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Creates a File object from various data formats including Uploadable, BlobPart, or AsyncIterable. ```APIDOC ## Steel.toFile ### Description Helper for creating a File object from various data formats for uploads. ### Signature `static toFile(value: ToFileInput, name?: string, options?: FilePropertyBag): Promise` ### Parameters - **value** (ToFileInput) - Required - Raw content (Uploadable, BlobPart, or AsyncIterable) - **name** (string) - Optional - File name; auto-detected from bits if omitted - **options** (FilePropertyBag) - Optional - Additional properties (type, lastModified) ### Returns - **Promise** - Promise resolving to a File-like object. ### Example ```typescript const file = await Steel.toFile(Buffer.from('content'), 'document.txt', { type: 'text/plain' }); ``` ``` -------------------------------- ### Create credentials Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Access the credentials resource to manage encrypted credentials. ```typescript const response = await client.credentials.create({ origin: 'https://example.com', username: 'user@example.com', password: 'password123', }); ``` -------------------------------- ### Define Session OptimizeBandwidth Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Configures bandwidth optimization settings for a session. ```typescript interface OptimizeBandwidth { blockHosts?: Array; blockImages?: boolean; blockMedia?: boolean; blockStylesheets?: boolean; blockUrlPatterns?: Array; } ``` -------------------------------- ### Create File from Local Path Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Generates a File object from a local filesystem path, restricted to Node.js environments. ```typescript const file = await Steel.fileFromPath('/path/to/file.pdf', 'upload.pdf'); ``` -------------------------------- ### Configure API Key via Constructor Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set the API key directly in the client constructor. ```typescript const client = new Steel({ steelAPIKey: 'sk_live_your_key_here', }); ``` -------------------------------- ### Handle API Responses Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Demonstrates how to handle API responses using APIPromise, including accessing raw response data and headers. ```typescript // Basic usage const session = await client.sessions.create(); // Access raw response const { data: session, response: raw } = await client.sessions.create().withResponse(); console.log(raw.headers); // Get Response object directly const response = await client.sessions.create().asResponse(); const headers = response.headers; ``` -------------------------------- ### Configure HTTP Agent Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set HTTP(S) connection behavior using proxies or custom agents. ```typescript import { HttpsProxyAgent } from 'https-proxy-agent'; const client = new Steel({ httpAgent: new HttpsProxyAgent('http://proxy.example.com:8080'), }); ``` ```typescript import http from 'http'; const agent = new http.Agent({ keepAlive: true, maxSockets: 50, }); const client = new Steel({ httpAgent: agent }); ``` ```typescript await client.sessions.create( { /* params */ }, { httpAgent: anotherAgent } ); ``` -------------------------------- ### Enable Debug Logging via Environment Variable Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set the DEBUG environment variable to true to enable request and response logging. ```bash export DEBUG=true ``` ```typescript process.env.DEBUG = 'true'; const client = new Steel(); // All requests and responses are logged ``` -------------------------------- ### client.extensions.download Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Downloads the file content of a specific extension. ```APIDOC ## download(extensionId: string, options?: Core.RequestOptions) ### Description Downloads an extension file by extension ID. ### Parameters - **extensionId** (string) - Required - Extension ID to download - **options** (Core.RequestOptions) - Optional - Request options ### Returns Core.APIPromise — Promise resolving to extension content/URL. ### Throws - NotFoundError — Extension not found ``` -------------------------------- ### Configure Default Query Parameters Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Include specific query parameters in all requests made by the client. ```typescript const client = new Steel({ defaultQuery: { api_version: '2024-01', }, }); ``` -------------------------------- ### client.profiles.list Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Profiles.md Retrieves a list of all browser profiles. ```APIDOC ## client.profiles.list ### Description Retrieves a list of all profiles. ### Parameters - **query** (ProfileListParams) - Optional - Query parameters for filtering - **options** (Core.RequestOptions) - Optional - Request options ### Returns Promise resolving to ProfileListResponse containing a list of profile objects. ### Example ```typescript const response = await client.profiles.list({ projectId: 'proj_abc' }); ``` ``` -------------------------------- ### List all extensions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Retrieves a list of all extensions associated with the organization. ```typescript const response = await client.extensions.list(); console.log(`Total extensions: ${response.count}`); for (const ext of response.extensions) { console.log(`${ext.name} (${ext.id}) - Created: ${ext.createdAt}`); } ``` -------------------------------- ### Define ClientOptions interface Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Use this interface to configure the global settings for the Steel client instance. ```typescript interface ClientOptions { steelAPIKey?: string | null | undefined; baseURL?: string | null | undefined; timeout?: number | undefined; httpAgent?: Agent | undefined; fetch?: Core.Fetch | undefined; maxRetries?: number | undefined; defaultHeaders?: Core.Headers | undefined; defaultQuery?: Core.DefaultQuery | undefined; } ``` -------------------------------- ### Create session Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Access the sessions resource for creating and managing browser sessions. ```typescript const session = await client.sessions.create(); ``` -------------------------------- ### Define Session DeviceConfig Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Sets the device type for the session. ```typescript interface DeviceConfig { device?: 'desktop' | 'mobile'; } ``` -------------------------------- ### Create File from Data Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Converts raw data into a File-like object suitable for uploads. ```typescript const file = await Steel.toFile(Buffer.from('content'), 'document.txt', { type: 'text/plain' }); ``` -------------------------------- ### Configure Base URL Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Set the API base URL via the constructor or environment variables. ```typescript const client = new Steel({ baseURL: 'https://custom-api.example.com', }); ``` ```bash export STEEL_BASE_URL='https://custom-api.example.com' ``` -------------------------------- ### Set Base URL via Environment Variable Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/endpoints.md Use the STEEL_BASE_URL environment variable to override the default API endpoint. ```bash STEEL_BASE_URL=https://custom-api.example.com ``` -------------------------------- ### List global files Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Files.md Retrieves a list of all global files, ordered by most recent first. ```typescript const response = await client.files.list(); console.log(response.data.length); for (const file of response.data) { console.log(file.path, file.size, file.lastModified); } ``` -------------------------------- ### List all profiles Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Profiles.md Retrieves a collection of profiles, optionally filtered by project ID. ```typescript const response = await client.profiles.list({ projectId: 'proj_abc' }); for (const profile of response.profiles) { console.log(profile.id, profile.status, profile.createdAt); } ``` -------------------------------- ### RequestOptions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Per-request override options for the Steel client. ```APIDOC ## RequestOptions ### Description Per-request override options. ### Interface ```typescript type RequestOptions = { timeout?: number; maxRetries?: number; headers?: Core.Headers; query?: Core.DefaultQuery; } ``` ``` -------------------------------- ### client.sessions.list Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Fetches all active sessions for the current organization with pagination support. ```APIDOC ## client.sessions.list(query?: SessionListParams, options?: Core.RequestOptions) ### Description Fetches all active sessions for the current organization with pagination support. ### Parameters - **query** (SessionListParams) - Optional - Query parameters for filtering and pagination - **options** (Core.RequestOptions) - Optional - Request options ### Returns `Core.PagePromise` — Async iterable for paginated session results. ``` -------------------------------- ### Iterate and Paginate Sessions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/README.md Use auto-paginating iteration or manual cursor-based pagination to list sessions. ```typescript // Auto-paginating iteration for await (const session of client.sessions.list({ status: 'live' })) { console.log(session.id); } // Manual pagination let page = await client.sessions.list(); while (page.hasNextPage()) { page = await page.getNextPage(); for (const session of page.sessions) { // Process session } } ``` -------------------------------- ### List extensions Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Access the extensions resource for managing Chrome extensions. ```typescript const extensions = await client.extensions.list(); ``` -------------------------------- ### Catch NotFoundError Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/errors.md Handle cases where a requested resource does not exist. ```typescript try { await client.sessions.retrieve('sess_doesnt_exist'); } catch (err) { if (err instanceof Steel.NotFoundError) { console.log('Session not found'); } } ``` -------------------------------- ### POST /v1/screenshot Source: https://github.com/steel-dev/steel-node/blob/main/api.md Captures a screenshot based on the provided parameters. ```APIDOC ## POST /v1/screenshot ### Description Captures a screenshot of the target. ### Method POST ### Endpoint /v1/screenshot ``` -------------------------------- ### client.profiles.update Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Profiles.md Updates an existing browser profile. ```APIDOC ## client.profiles.update ### Description Updates an existing profile. ### Parameters - **id** (string) - Required - Profile ID to update - **params** (ProfileUpdateParams) - Required - Update parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns Promise resolving to ProfileUpdateResponse containing updated profile metadata. ### Example ```typescript const updated = await client.profiles.update('prof_xyz789', { extensionIds: ['ext_789'], userAgent: 'Mozilla/5.0...', }); ``` ``` -------------------------------- ### POST /v1/pdf Source: https://github.com/steel-dev/steel-node/blob/main/api.md Generates a PDF from the provided parameters. ```APIDOC ## POST /v1/pdf ### Description Generates a PDF document. ### Method POST ### Endpoint /v1/pdf ``` -------------------------------- ### POST /v1/sessions/{sessionId}/computer Source: https://github.com/steel-dev/steel-node/blob/main/api.md Perform computer operations on a session. ```APIDOC ## POST /v1/sessions/{sessionId}/computer ### Description Perform computer operations on a session. ### Method POST ### Endpoint /v1/sessions/{sessionId}/computer ### Parameters #### Path Parameters - **sessionId** (string) - Required - The session ID. ### Response #### Success Response (200) - **SessionComputerResponse** (object) - The computer operation response. ``` -------------------------------- ### Configure Default and Per-Request HTTP Agents Source: https://github.com/steel-dev/steel-node/blob/main/README.md Set a default HTTP agent for all requests using HttpsProxyAgent for proxy support, or override it for individual requests with a custom http.Agent. ```typescript import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: const client = new Steel({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); // Override per-request: await client.sessions.create({ httpAgent: new http.Agent({ keepAlive: false }), }); ``` -------------------------------- ### pdf(body: PdfParams, options?: Core.RequestOptions) Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Steel.md Generates a PDF from a specified webpage. ```APIDOC ## pdf(body: PdfParams, options?: Core.RequestOptions) ### Description Generates a PDF from a specified webpage. ### Parameters - **body** (PdfParams) - Required - Request parameters - **options** (Core.RequestOptions) - Optional - Request options (timeout, maxRetries, etc.) ### Returns - **Core.APIPromise** - Promise resolving to PDF response with hosted URL. ### Example ```typescript const pdf = await client.pdf({ url: 'https://example.com', delay: 1000, useProxy: true, }); console.log(pdf.url); ``` ``` -------------------------------- ### Define Fileslist interface Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/types.md Represents the list of files returned by files.list(). ```typescript interface Fileslist { data: Array; } namespace Fileslist { interface Data { lastModified: string; path: string; size: number; } } ``` -------------------------------- ### Retrieve live session details in TypeScript Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Returns the current state of a session, including active pages and tabs. ```typescript const details = await client.sessions.liveDetails('sess_abc123'); console.log(details.pages); console.log(details.tabs); ``` -------------------------------- ### liveDetails(id: string, options?: Core.RequestOptions) Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Sessions.md Returns the live state of the session, including pages, tabs, and browser state. ```APIDOC ## liveDetails(id: string, options?: Core.RequestOptions) ### Description Returns the live state of the session, including pages, tabs, and browser state. ### Parameters - **id** (string) - Required - Session ID - **options** (Core.RequestOptions) - Optional - Request options ### Returns - **Core.APIPromise** - Promise resolving to live session details. ### Example ```typescript const details = await client.sessions.liveDetails('sess_abc123'); ``` ``` -------------------------------- ### Iterate Through All Paginated Items with `for await...of` Source: https://github.com/steel-dev/steel-node/blob/main/README.md Use the `for await...of` syntax to easily iterate through all items across multiple pages of a paginated list. This method automatically fetches subsequent pages as needed. ```typescript async function fetchAllSessions(params) { const allSessions = []; // Automatically fetches more pages as needed. for await (const session of client.sessions.list({ status: 'live' })) { allSessions.push(session); } return allSessions; } ``` -------------------------------- ### client.extensions.upload Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/api-reference/Extensions.md Uploads a Chrome extension (.zip/.crx file or Chrome Web Store URL) for the organization. ```APIDOC ## upload(body?: ExtensionUploadParams, options?: Core.RequestOptions) ### Description Uploads a Chrome extension (.zip/.crx file or Chrome Web Store URL) for the organization. ### Parameters - **body** (ExtensionUploadParams) - Optional - Upload parameters - **options** (Core.RequestOptions) - Optional - Request options ### Returns Core.APIPromise — Promise resolving to extension metadata. ### Throws - BadRequestError — Invalid extension format ``` -------------------------------- ### Configure Custom Headers Source: https://github.com/steel-dev/steel-node/blob/main/_autodocs/configuration.md Add custom headers to all requests via the constructor or environment variables. ```typescript const client = new Steel({ defaultHeaders: { 'X-Custom-Header': 'value', 'X-Request-ID': 'my-request-id', }, }); ``` ```bash export STEEL_CUSTOM_HEADERS="X-Custom-Header: value X-Another-Header: another-value" ```