New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-kendra

Package Overview
Dependencies
Maintainers
4
Versions
446
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-kendra

@aws-sdk/client-kendra client

  • 1.0.0-alpha.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
84K
decreased by-16.98%
Maintainers
4
Weekly downloads
 
Created

What is @aws-sdk/client-kendra?

@aws-sdk/client-kendra is an AWS SDK for JavaScript package that allows developers to interact with Amazon Kendra, a highly accurate and easy-to-use enterprise search service powered by machine learning. This package provides methods to create, manage, and query indexes, data sources, and other resources within Amazon Kendra.

What are @aws-sdk/client-kendra's main functionalities?

Create Index

This feature allows you to create a new index in Amazon Kendra. The code sample demonstrates how to use the CreateIndexCommand to create an index with a specified name, role ARN, and edition.

const { KendraClient, CreateIndexCommand } = require('@aws-sdk/client-kendra');

const client = new KendraClient({ region: 'us-west-2' });

const params = {
  Name: 'MyIndex',
  RoleArn: 'arn:aws:iam::123456789012:role/service-role/AmazonKendra-role',
  Edition: 'DEVELOPER_EDITION'
};

const run = async () => {
  try {
    const data = await client.send(new CreateIndexCommand(params));
    console.log('Index created:', data);
  } catch (err) {
    console.error('Error creating index:', err);
  }
};

run();

Query Index

This feature allows you to query an existing index in Amazon Kendra. The code sample demonstrates how to use the QueryCommand to search an index using a specified query text.

const { KendraClient, QueryCommand } = require('@aws-sdk/client-kendra');

const client = new KendraClient({ region: 'us-west-2' });

const params = {
  IndexId: 'index-id',
  QueryText: 'search query'
};

const run = async () => {
  try {
    const data = await client.send(new QueryCommand(params));
    console.log('Query results:', data);
  } catch (err) {
    console.error('Error querying index:', err);
  }
};

run();

List Data Sources

This feature allows you to list all data sources associated with a specific index in Amazon Kendra. The code sample demonstrates how to use the ListDataSourcesCommand to retrieve and display the data sources.

const { KendraClient, ListDataSourcesCommand } = require('@aws-sdk/client-kendra');

const client = new KendraClient({ region: 'us-west-2' });

const params = {
  IndexId: 'index-id'
};

const run = async () => {
  try {
    const data = await client.send(new ListDataSourcesCommand(params));
    console.log('Data sources:', data);
  } catch (err) {
    console.error('Error listing data sources:', err);
  }
};

run();

Other packages similar to @aws-sdk/client-kendra

FAQs

Package last updated on 30 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc