@shipstatic/ship 0.1.19 → 0.1.21

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/README.md CHANGED
@@ -36,11 +36,18 @@ npm install @shipstatic/ship
36
36
  ```typescript
37
37
  import { Ship } from '@shipstatic/ship';
38
38
 
39
+ // Authenticated deployments with API key
39
40
  const ship = new Ship({
40
41
  apiUrl: 'https://api.shipstatic.com',
41
42
  apiKey: 'ship-your-64-char-hex-string' // API key: ship- prefix + 64-char hex (69 chars total)
42
43
  });
43
44
 
45
+ // OR single-use deployments with deploy token
46
+ const ship = new Ship({
47
+ apiUrl: 'https://api.shipstatic.com',
48
+ deployToken: 'token-your-64-char-hex-string' // Deploy token: token- prefix + 64-char hex (70 chars total)
49
+ });
50
+
44
51
  // Deploy project - SDK automatically fetches platform configuration
45
52
  const result = await ship.deployments.create(['./dist'], {
46
53
  onProgress: (progress) => console.log(`${progress}%`)
@@ -108,6 +115,7 @@ const ship = new Ship(options?: ShipOptions)
108
115
  interface ShipOptions {
109
116
  apiUrl?: string; // API endpoint (default: https://api.shipstatic.com)
110
117
  apiKey?: string; // API key: ship- prefix + 64-char hex (69 chars total)
118
+ deployToken?: string; // Deploy token: token- prefix + 64-char hex (70 chars total)
111
119
  timeout?: number; // Request timeout (ms)
112
120
  }
113
121
  ```
@@ -153,6 +161,7 @@ type BrowserDeployInput = FileList | File[] | HTMLInputElement;
153
161
  interface DeployOptions {
154
162
  apiUrl?: string;
155
163
  apiKey?: string; // API key: ship- prefix + 64-char hex (69 chars total)
164
+ deployToken?: string; // Deploy token: token- prefix + 64-char hex (70 chars total)
156
165
  signal?: AbortSignal; // Cancellation
157
166
  subdomain?: string; // Custom subdomain
158
167
  onCancel?: () => void;
@@ -266,7 +275,10 @@ error.isConfigError() // Configuration problems
266
275
 
267
276
  ## Authentication
268
277
 
269
- The Ship SDK uses **Bearer token authentication** with API keys that have a `ship-` prefix:
278
+ The Ship SDK supports two authentication methods:
279
+
280
+ ### API Keys (Authenticated Deployments)
281
+ For persistent authentication with full account access:
270
282
 
271
283
  ```typescript
272
284
  const ship = new Ship({
@@ -274,12 +286,22 @@ const ship = new Ship({
274
286
  });
275
287
  ```
276
288
 
289
+ ### Deploy Tokens (Single-Use Deployments)
290
+ For temporary, single-use deployments:
291
+
292
+ ```typescript
293
+ const ship = new Ship({
294
+ deployToken: 'token-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
295
+ });
296
+ ```
297
+
277
298
  ### API Requests
278
299
 
279
- The SDK automatically sends API keys using standard Bearer token format:
300
+ The SDK automatically sends credentials using standard Bearer token format:
280
301
 
281
302
  ```
282
- Authorization: Bearer ship-your-64-char-hex-string // 69 chars total
303
+ Authorization: Bearer ship-your-64-char-hex-string // API key (69 chars total)
304
+ Authorization: Bearer token-your-64-char-hex-string // Deploy token (70 chars total)
283
305
  ```
284
306
 
285
307
  ## Configuration
@@ -315,6 +337,7 @@ Configuration is loaded hierarchically (highest precedence first):
315
337
  ```bash
316
338
  export SHIP_API_URL="https://api.shipstatic.com"
317
339
  export SHIP_API_KEY="ship-your-api-key"
340
+ export SHIP_DEPLOY_TOKEN="token-your-deploy-token"
318
341
  ```
319
342
 
320
343
  ## CLI Commands
@@ -346,9 +369,10 @@ ship account # Get account details
346
369
  ### Global Options
347
370
 
348
371
  ```bash
349
- -u, --apiUrl <URL> # API endpoint
350
- -k, --apiKey <KEY> # API key
351
- --json # JSON output
372
+ -u, --apiUrl <URL> # API endpoint
373
+ -k, --apiKey <KEY> # API key for authenticated deployments
374
+ --deploy-token <TOKEN> # Deploy token for single-use deployments
375
+ --json # JSON output
352
376
  ```
353
377
 
354
378
  ## Bundle Sizes