@vizzly-testing/cli 0.7.2 → 0.8.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/README.md CHANGED
@@ -368,7 +368,7 @@ Check if Vizzly is enabled in the current environment.
368
368
 
369
369
  ### Core Configuration
370
370
  - `VIZZLY_TOKEN`: API authentication token. Example: `export VIZZLY_TOKEN=your-token`.
371
- - `VIZZLY_API_URL`: Override API base URL. Default: `https://vizzly.dev`.
371
+ - `VIZZLY_API_URL`: Override API base URL. Default: `https://app.vizzly.dev`.
372
372
  - `VIZZLY_LOG_LEVEL`: Logger level. One of `debug`, `info`, `warn`, `error`. Example: `export VIZZLY_LOG_LEVEL=debug`.
373
373
 
374
374
  ### Parallel Builds
@@ -190,7 +190,9 @@ export async function uploadCommand(screenshotsPath, options = {}, globalOptions
190
190
  // Silent fail on cleanup
191
191
  }
192
192
  }
193
- ui.error('Upload failed', error);
193
+ // Use user-friendly error message if available
194
+ const errorMessage = error?.getUserMessage ? error.getUserMessage() : error.message;
195
+ ui.error(errorMessage || 'Upload failed', error);
194
196
  }
195
197
  }
196
198
 
package/dist/sdk/index.js CHANGED
@@ -30,7 +30,7 @@ import { VizzlyError } from '../errors/vizzly-error.js';
30
30
  *
31
31
  * const vizzly = await createVizzly({
32
32
  * apiKey: process.env.VIZZLY_TOKEN,
33
- * apiUrl: 'https://vizzly.dev',
33
+ * apiUrl: 'https://app.vizzly.dev',
34
34
  * server: {
35
35
  * port: 3003,
36
36
  * enabled: true
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { URLSearchParams } from 'url';
7
- import { VizzlyError } from '../errors/vizzly-error.js';
7
+ import { VizzlyError, AuthError } from '../errors/vizzly-error.js';
8
8
  import crypto from 'crypto';
9
9
  import { getPackageVersion } from '../utils/package-info.js';
10
10
  import { getApiUrl, getApiToken, getUserAgent } from '../utils/environment-config.js';
@@ -58,6 +58,11 @@ export class ApiService {
58
58
  } catch {
59
59
  // ignore
60
60
  }
61
+
62
+ // Handle authentication errors with user-friendly messages
63
+ if (response.status === 401) {
64
+ throw new AuthError('Invalid or expired API token. Please check your VIZZLY_TOKEN environment variable and ensure it is valid.');
65
+ }
61
66
  throw new VizzlyError(`API request failed: ${response.status}${errorText ? ` - ${errorText}` : ''} (URL: ${url})`);
62
67
  }
63
68
  return response.json();
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * const vizzly = await createVizzly({
12
12
  * apiKey: process.env.VIZZLY_TOKEN,
13
- * apiUrl: 'https://vizzly.dev',
13
+ * apiUrl: 'https://app.vizzly.dev',
14
14
  * server: {
15
15
  * port: 3003,
16
16
  * enabled: true
@@ -64,7 +64,7 @@ export async function loadConfig(configPath = null, cliOverrides = {}) {
64
64
  const envApiUrl = getApiUrl();
65
65
  const envParallelId = getParallelId();
66
66
  if (envApiKey) config.apiKey = envApiKey;
67
- if (envApiUrl !== 'https://vizzly.dev') config.apiUrl = envApiUrl;
67
+ if (envApiUrl !== 'https://app.vizzly.dev') config.apiUrl = envApiUrl;
68
68
  if (envParallelId) config.parallelId = envParallelId;
69
69
 
70
70
  // 3. Apply CLI overrides (highest priority)
@@ -43,9 +43,10 @@ export class ConsoleUI {
43
43
  timestamp: new Date().toISOString()
44
44
  };
45
45
  if (error instanceof Error) {
46
+ const errorMessage = error.getUserMessage ? error.getUserMessage() : error.message;
46
47
  errorData.error = {
47
48
  name: error.name,
48
- message: error.message,
49
+ message: errorMessage,
49
50
  ...(this.verbose && {
50
51
  stack: error.stack
51
52
  })
@@ -16,7 +16,7 @@ export function getApiToken() {
16
16
  * @returns {string} API URL with default
17
17
  */
18
18
  export function getApiUrl() {
19
- return process.env.VIZZLY_API_URL || 'https://vizzly.dev';
19
+ return process.env.VIZZLY_API_URL || 'https://app.vizzly.dev';
20
20
  }
21
21
 
22
22
  /**
@@ -470,7 +470,7 @@ Configuration loaded via cosmiconfig in this order:
470
470
  {
471
471
  // API Configuration
472
472
  apiKey: string, // API token (from VIZZLY_TOKEN)
473
- apiUrl: string, // API base URL (default: 'https://vizzly.dev')
473
+ apiUrl: string, // API base URL (default: 'https://app.vizzly.dev')
474
474
  project: string, // Project ID override
475
475
 
476
476
  // Server Configuration (for run command)
@@ -30,7 +30,7 @@ vizzly doctor --json
30
30
 
31
31
  ## Environment Variables
32
32
 
33
- - `VIZZLY_API_URL` — Override the API base URL (default: `https://vizzly.dev`)
33
+ - `VIZZLY_API_URL` — Override the API base URL (default: `https://app.vizzly.dev`)
34
34
  - `VIZZLY_TOKEN` — API token used only when `--api` is provided
35
35
 
36
36
  ## Exit Codes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizzly-testing/cli",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Visual review platform for UI developers and designers",
5
5
  "keywords": [
6
6
  "visual-testing",