For the complete documentation index, see llms.txt. This page is also available as Markdown.

Debugging

Logging

The SDK logger is disabled by default.

import { VGSLogger, VGSShowError } from "@vgs/show-react-native";

VGSLogger.shared.configuration = {
  level: "none",
  isNetworkDebugEnabled: false,
  isExtensiveDebugEnabled: false
};

Log levels:

Level
Description

"info"

Records informational and warning entries.

"warning"

Records warnings only.

"none"

Records no entries. This is the default.

Diagnostic logging should stay disabled in production. Network debug logging can include response bodies and must be treated as sensitive.

Development-only example:

if (__DEV__) {
  VGSLogger.shared.configuration = {
    level: "warning",
    isNetworkDebugEnabled: false,
    isExtensiveDebugEnabled: false
  };
}

Do not log request payloads, response bodies, custom header values, tokens, authorization values, revealed text, media base64, hashes, lengths, or customer identifiers.

Access Logger

For route-level investigation, use the VGS Dashboard Access Logger. It can help verify whether a reveal request reached VGS, which route matched, and whether the upstream response shape matches your component contentPath values.

Error handling

SDK request failures and component reveal failures use VGSShowError.

Use type or code for branching:

Error codes

Code
Type
Description

1400

unexpectedResponseType

Response type or transport result is not supported.

1401

unexpectedResponseDataFormat

Response data format is not supported.

1402

responseIsInvalidJSON

Response body cannot be decoded to a JSON object.

1403

fieldNotFound

A component could not find or decode its contentPath.

1404

invalidJSONPayload

Request payload is not a valid plain JSON object.

1405

invalidBase64Data

Media field is not valid base64.

1406

invalidPDFData

PDF data cannot be rendered.

1407

invalidImageData

Image data cannot be rendered.

1480

invalidConfigurationURL

Vault environment or configuration URL is invalid.

Common issues

Symptom
Likely cause
Fix

Component stays on placeholder

contentPath is empty, missing, or points to the wrong JSON field.

Compare the route response shape with each component path.

request() resolves but one field is empty

HTTP and JSON succeeded, but that component failed to decode its field.

Handle component error callbacks and validate response field types.

invalidBase64Data

Image or PDF field is not strict base64.

Return base64 content at the configured path.

invalidPDFData

Base64 decoded but is not renderable PDF data.

Validate the PDF server-side and increase request timeout for large files.

invalidImageData

Base64 decoded but the image cannot render.

Return renderable image data supported by the native renderer.

Web build fails

The SDK supports iOS and Android only.

Keep SDK imports out of web entrypoints.

Last updated