UI Widgets/Configuration

Configuration Guide

Configure authentication and initialize widgets in your application

SDK Configuration Parameters

Both integration modes require the same core configuration parameters for authentication and initialization.

SDK authentication and initialization configuration parameters
ParameterTypeRequiredDescription
loginId string YesCurrently logged-in user's login identifier from your system. Use an email address or phone number supported by your account system.
email string No (legacy)Legacy email field kept for compatibility. New integrations should use loginId.
companyId string YesCompany ID provided by Eureka
publicKey string YesPublic key provided by Eureka for RSA encryption
JSEncrypt constructor YesGlobal JSEncrypt constructor from the library
iframe HTMLElement iframe onlyiframe DOM element for embedding mode

New Window Mode Configuration

Configure the SDK to open AI Agents in a new browser window. This mode is ideal for standalone workflows and complex analysis tasks.

JavaScript
const PatsnapAgentNewTab = window.PatsnapAgentSDK.AgentNewTab;
const AGENT_NAME = window.PatsnapAgentSDK.AGENT_NAME;

// Initialize SDK
const agentNewTab = new PatsnapAgentNewTab({
  loginId: 'user@yourcompany.com',
  companyId: 'your-company-id',
  publicKey: 'YOUR_PUBLIC_KEY',
  JSEncrypt: window.JSEncrypt,
});

// Login and open agent
document.getElementById('btn').addEventListener('click', async () => {
  try {
    await agentNewTab.login();
    await agentNewTab.openAgent(AGENT_NAME.NOVELTY_SEARCH);
  } catch (error) {
    console.error('Failed to open agent:', error);
  }
});

iframe Embedding Mode Configuration

Configure the SDK to embed AI Agents directly into your page. This mode provides seamless integration within your existing UI.

HTML
<iframe id="agent-iframe" style="width: 100%; height: 600px; border: none;"></iframe>
JavaScript
const AgentIframe = window.PatsnapAgentSDK.AgentIframe;
const AGENT_NAME = window.PatsnapAgentSDK.AGENT_NAME;

const iframe = document.getElementById('agent-iframe');

// Initialize SDK
const agentIframe = new AgentIframe({
  loginId: 'user@yourcompany.com',
  companyId: 'your-company-id',
  publicKey: 'YOUR_PUBLIC_KEY',
  JSEncrypt: window.JSEncrypt,
  iframe: iframe,
});

// Login and initialize agent
document.getElementById('btn').addEventListener('click', async () => {
  try {
    await agentIframe.login();
    await agentIframe.init(AGENT_NAME.NOVELTY_SEARCH);
  } catch (error) {
    console.error('Failed to initialize agent:', error);
  }
});

Important: iframe mode requires CSP (Content Security Policy) configuration. Add Eureka domains to your whitelist, or use new window mode if CSP configuration is not possible.

Advanced Configuration

Customize widget behavior with advanced configuration options for export handling and question pre-filling.

Export Configuration

Control how AI Agents handle report exports. Available for Patent Disclosure agent only.

const EXPORT_BEHAVIOR = window.PatsnapAgentSDK.EXPORT_BEHAVIOR;

await agentNewTab.openAgent(AGENT_NAME.PATENT_DISCLOSURE, {
  exportConfig: {
    behavior: EXPORT_BEHAVIOR.EVENT_ONLY,
  },
  eventListeners: {
    exportReport: (eventData) => {
      console.log('Export task ID:', eventData.taskId);
      // Use taskId to call OpenAPI endpoint for report download
    }
  }
});

Question Configuration

Pre-fill questions when opening an agent to streamline user workflows.

await agentNewTab.openAgent(AGENT_NAME.TECHNICAL_QA, {
  questionConfig: {
    input: 'Explain machine learning overfitting',
    enableInputAppendToJob: true  // Use as initial question
  }
});

Available Agents

Access 30+ AI Agent widgets across multiple domains. Use the AGENT_NAME constants to specify which agent to open.

Research & Innovation

RESEARCHTECHNICAL_QAFIND_SOLUTIONTRIZAIR_AI_AGENTNOVELTY_CHECKCOMPANY_SEARCHCOMPETITIVE_LANDSCAPETECHNOLOGY_ROADMAP

Intellectual Property

NOVELTY_SEARCHPATENT_DISCLOSURESEMANTIC_SEARCHAI_SPECIFICATIONIMAGE_FTO_SEARCHFTO_PRO

Life Sciences

LS_PIALS_PCIELS_PDALS_LCA

Materials

FIND_SOLUTIONS_MATERIALS_V2MATERIAL_SCOUTMATERIAL_STRUCTURE_SEARCHMATERIAL_TECHNICAL_QAMATERIAL_SMART_SEARCHMATERIAL_SUBSTANCE_EXPLORATIONMATERIAL_PDAMATERIAL_WORKFLOWMATERIAL_PROPERTYMATERIAL_METALMATERIAL_DFMEA_ASSISTANTMATERIAL_ALLOY_RESEARCHERMATERIAL_FORMULATION_AGENT

See the complete list of available agents and their capabilities in the API Reference section of the agent integration documentation.

Next Steps

Configuration complete! Check the FAQ section for common issues and troubleshooting tips, or start integrating widgets into your application.