1
1
# SFC Nodes TypeScript API Library
2
2
3
- [ ![ NPM version] ( < https://img.shields.io/npm/v/@sfc /nodes-sdk-alpha.svg?label=npm%20(stable) > )] ( https://npmjs.org/package/@sfc /nodes-sdk-alpha ) ![ npm bundle size] ( https://img.shields.io/bundlephobia/minzip/@sfc /nodes-sdk-alpha )
3
+ [ ![ NPM version] ( < https://img.shields.io/npm/v/@sfcompute /nodes-sdk-alpha.svg?label=npm%20(stable) > )] ( https://npmjs.org/package/@sfcompute /nodes-sdk-alpha ) ![ npm bundle size] ( https://img.shields.io/bundlephobia/minzip/@sfcompute /nodes-sdk-alpha )
4
4
5
5
This library provides convenient access to the SFC Nodes REST API from server-side TypeScript or JavaScript.
6
6
@@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/).
11
11
## Installation
12
12
13
13
``` sh
14
- npm install @sfc /nodes-sdk-alpha
14
+ npm install @sfcompute /nodes-sdk-alpha
15
15
```
16
16
17
17
## Usage
@@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md).
20
20
21
21
<!-- prettier-ignore -->
22
22
``` js
23
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
23
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
24
24
25
25
const client = new SFCNodes ({
26
26
apiKey: process .env [' SFC_API_KEY' ], // This is the default and can be omitted
@@ -35,7 +35,7 @@ This library includes TypeScript definitions for all request params and response
35
35
36
36
<!-- prettier-ignore -->
37
37
``` ts
38
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
38
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
39
39
40
40
const client = new SFCNodes ({
41
41
apiKey: process .env [' SFC_API_KEY' ], // This is the default and can be omitted
@@ -157,7 +157,7 @@ The log level can be configured in two ways:
157
157
2 . Using the ` logLevel ` client option (overrides the environment variable if set)
158
158
159
159
``` ts
160
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
160
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
161
161
162
162
const client = new SFCNodes ({
163
163
logLevel: ' debug' , // Show all log messages
@@ -185,7 +185,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
185
185
below the configured level will not be sent to your logger.
186
186
187
187
``` ts
188
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
188
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
189
189
import pino from ' pino' ;
190
190
191
191
const logger = pino ();
@@ -254,7 +254,7 @@ globalThis.fetch = fetch;
254
254
Or pass it to the client:
255
255
256
256
``` ts
257
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
257
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
258
258
import fetch from ' my-fetch' ;
259
259
260
260
const client = new SFCNodes ({ fetch });
@@ -265,7 +265,7 @@ const client = new SFCNodes({ fetch });
265
265
If you want to set custom ` fetch ` options without overriding the ` fetch ` function, you can provide a ` fetchOptions ` object when instantiating the client or making a request. (Request-specific options override client options.)
266
266
267
267
``` ts
268
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
268
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
269
269
270
270
const client = new SFCNodes ({
271
271
fetchOptions: {
@@ -282,7 +282,7 @@ options to requests:
282
282
<img src =" https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg " align =" top " width =" 18 " height =" 21 " > ** Node** <sup >[[ docs] ( https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch )] </sup >
283
283
284
284
``` ts
285
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
285
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
286
286
import * as undici from ' undici' ;
287
287
288
288
const proxyAgent = new undici .ProxyAgent (' http://localhost:8888' );
@@ -296,7 +296,7 @@ const client = new SFCNodes({
296
296
<img src =" https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg " align =" top " width =" 18 " height =" 21 " > ** Bun** <sup >[[ docs] ( https://bun.sh/guides/http/proxy )] </sup >
297
297
298
298
``` ts
299
- import SFCNodes from ' @sfc /nodes-sdk-alpha' ;
299
+ import SFCNodes from ' @sfcompute /nodes-sdk-alpha' ;
300
300
301
301
const client = new SFCNodes ({
302
302
fetchOptions: {
@@ -308,7 +308,7 @@ const client = new SFCNodes({
308
308
<img src =" https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg " align =" top " width =" 18 " height =" 21 " > ** Deno** <sup >[[ docs] ( https://docs.deno.com/api/deno/~/Deno.createHttpClient )] </sup >
309
309
310
310
``` ts
311
- import SFCNodes from ' npm:@sfc /nodes-sdk-alpha' ;
311
+ import SFCNodes from ' npm:@sfcompute /nodes-sdk-alpha' ;
312
312
313
313
const httpClient = Deno .createHttpClient ({ proxy: { url: ' http://localhost:8888' } });
314
314
const client = new SFCNodes ({
0 commit comments