Nutrient Web SDK
    Preparing search index...

    Interface Configuration

    Configuration for the AI Assistant feature.

    Contains authentication details, backend connection information, and optional customization settings for AI Agent behavior.

    NutrientViewer.load({
    // ... other config
    aiAssistant: {
    sessionId: 'session-123',
    jwt: 'eyJhbGciOiJIUzI1NiIs...',
    backendUrl: 'https://localhost:4000'
    }
    })
    interface Configuration {
        agentConfiguration?: AgentConfiguration;
        agentId?: string;
        backendUrl: string;
        jwt: string;
        sessionId: string;
        userId?: string;
    }
    Index

    Properties

    agentConfiguration?: AgentConfiguration

    Advanced configuration for customizing AI Assistant agent behavior.

    Customize the system prompt, define specialized skills, configure tool execution approval policies.

    NutrientViewer.load({
    aiAssistant: {
    sessionId: 'session-123',
    jwt: 'token-here',
    backendUrl: 'https://localhost:4000',
    agentConfiguration: {
    systemPromptTemplate: 'You are an expert legal document assistant.',
    skills: [
    {
    name: 'contract-review',
    description: 'Analyze contracts for key terms',
    content: 'Focus on liability and payment terms...'
    }
    ],
    toolApproval: {
    defaults: { default: 'allow', write: 'ask' }
    }
    }
    }
    });
    agentId?: string

    AI Agent preset or custom agent ID.

    Selects a base agent configuration with different capabilities and behavior.

    Preset Purpose
    chat Read-only Q&A mode. This agent can summarize, extract data, and answer questions.
    agentic Full autonomous agent. This agent can read, write, add annotations, fill forms, and redact documents.
    base Base configuration. This agent uses defaults for all settings and is intended for customization.
    'agentic'
    
    agentId: 'chat'  // Use the read-only chat preset
    
    backendUrl: string

    URL of the AI Assistant service backend.

    This should be the base URL where your AI Assistant service is deployed. The URL must include the protocol (http/https) but exclude trailing slashes.

    backendUrl: 'https://ai-assistant.example.com' // ✓ correct
    backendUrl: 'https://ai-assistant.example.com/' // ✗ avoid trailing slash
    jwt: string

    JSON Web Token (JWT) for authenticating requests to the AI Assistant backend.

    This token must be issued by your authentication service and should contain user identity claims. The token is sent with every request to the backend.

    jwt: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
    
    sessionId: string

    Session identifier for the AI Assistant conversation.

    Use a unique identifier to create a new session, or reuse an existing session ID to restore a previous conversation. The ID must contain only alphanumeric characters.

    sessionId: 'userdocsession20250128'
    sessionId: 'session123abc'
    userId?: string

    Optional user identifier for tracking and rate limiting.

    Provide a unique identifier for the current user. This enables per-user rate limiting, usage analytics, and audit logging. Must contain only alphanumeric characters.

    userId: 'userabc12345'
    userId: 'user123'