Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@sharpapi/sharpapi-node-client
Advanced tools
SharpAPI.com Node.js SDK Client - AI-powered workflow automation API.
SharpAPI.com Node.js SDK Client is an AI-powered workflow automation API that enables developers to integrate advanced artificial intelligence capabilities into their Node.js applications. This SDK simplifies interaction with the SharpAPI services, providing a seamless way to leverage AI for various use cases.
See more at SharpAPI.com Website »
npm i @sharpapi/sharpapi-node-client
You can install the SharpAPI Node.js SDK Client using npm:
npm install @sharpapi/sharpapi-node-client
Alternatively, if you prefer using Yarn:
yarn add @sharpapi/sharpapi-node-client
To protect your credentials, it's recommended to use a .env
file to store your SharpAPI API key. Follow these steps:
Create a .env
File
In the root directory of your project, create a file named .env
:
SHARP_API_KEY=your_actual_api_key_here
Install dotenv
Package
To load environment variables from the .env
file, install the dotenv
package:
npm install dotenv
Load Environment Variables
At the beginning of your application (e.g., in app.js
or index.js
), add the following line to load the environment variables:
require('dotenv').config();
Ensure .env
is Ignored
Add .env
to your .gitignore
file to prevent sensitive information from being committed to version control:
# .gitignore
.env
First, import and initialize the SharpApiService
with your API key:
// Load environment variables
require('dotenv').config();
// Import the SharpApiService
const { SharpApiService } = require('@sharpapi/sharpapi-node-client');
// Initialize the SharpApiService
const apiKey = process.env.SHARP_API_KEY;
const sharpApi = new SharpApiService(apiKey);
The SharpApiService
class provides various methods to interact with SharpAPI endpoints. Below is a list of available methods along with their descriptions:
const pingResponse = await sharpApi.ping();
console.log(pingResponse);
const quotaInfo = await sharpApi.quota();
console.log(quotaInfo);
filePath
(string): Path to the resume file.language
(string, optional): Language of the resume (default: 'English').const statusUrl = await sharpApi.parseResume('path/to/resume.pdf', 'English');
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
jobDescriptionParameters
(JobDescriptionParameters): Object containing job details.const { JobDescriptionParameters } = require('@sharpapi/sharpapi-node-client');
const jobDescriptionParams = new JobDescriptionParameters(
"Software Engineer",
"Tech Corp",
["Develop applications", "Collaborate with teams"],
["Proficiency in JavaScript", "Experience with APIs"],
"English",
"Professional",
null
);
const statusUrl = await sharpApi.generateJobDescription(jobDescriptionParams);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
skillName
(string): The skill to find related skills for.language
(string, optional): Language of the response (default: 'English').maxQuantity
(number, optional): Maximum number of related skills to retrieve.const statusUrl = await sharpApi.relatedSkills("JavaScript", "English", 5);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
jobPositionName
(string): The job position to find related positions for.language
(string, optional): Language of the response (default: 'English').maxQuantity
(number, optional): Maximum number of related job positions to retrieve.const statusUrl = await sharpApi.relatedJobPositions("Frontend Developer", "English", 5);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
review
(string): The product review text.const statusUrl = await sharpApi.productReviewSentiment("This product is amazing!");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
productName
(string): Name of the product.language
(string, optional): Language of the response (default: 'English').maxQuantity
(number, optional): Maximum number of categories to generate.voiceTone
(string, optional): Tone of the voice in the response (e.g., 'Neutral').context
(string, optional): Additional context for category generation.const statusUrl = await sharpApi.productCategories("Smartphone", "English", 5, "Neutral", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
productData
(string): Detailed description of the product.language
(string, optional): Language of the response (default: 'English').maxLength
(number, optional): Maximum length of the introduction.voiceTone
(string, optional): Tone of the voice in the response (e.g., 'Friendly').const statusUrl = await sharpApi.generateProductIntro("This smartphone features...", "English", 100, "Friendly");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
productName
(string): Name of the purchased product.language
(string, optional): Language of the email (default: 'English').maxLength
(number, optional): Maximum length of the email.voiceTone
(string, optional): Tone of the voice in the email (e.g., 'Professional').context
(string, optional): Additional context for the email generation.const statusUrl = await sharpApi.generateThankYouEmail("Smartphone", "English", 200, "Professional", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to scan for phone numbers.const statusUrl = await sharpApi.detectPhones("Contact me at 123-555-7890.");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to scan for email addresses.const statusUrl = await sharpApi.detectEmails("Please email us at support@example.com.");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to analyze for spam.const statusUrl = await sharpApi.detectSpam("Congratulations! You've won a free prize.");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to summarize.language
(string, optional): Language of the summary (default: 'English').maxLength
(number, optional): Maximum length of the summary.voiceTone
(string, optional): Tone of the voice in the summary (e.g., 'Neutral').context
(string, optional): Additional context for the summarization.const statusUrl = await sharpApi.summarizeText("Long article text...", "English", 50, "Neutral", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The content to extract keywords from.language
(string, optional): Language of the keywords (default: 'English').maxQuantity
(number, optional): Maximum number of keywords to generate.voiceTone
(string, optional): Tone of the voice in the keywords (e.g., 'Neutral').context
(string, optional): Additional context for keyword generation.const statusUrl = await sharpApi.generateKeywords("Content for keyword extraction...", "English", 5, "Neutral", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to translate.language
(string): The target language for translation (e.g., 'Spanish').voiceTone
(string, optional): Tone of the voice in the translation (e.g., 'Neutral').context
(string, optional): Additional context for translation.const statusUrl = await sharpApi.translate("Hello, world!", "Spanish", "Neutral", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to paraphrase.language
(string, optional): Language of the paraphrase (default: 'English').maxLength
(number, optional): Maximum length of the paraphrased text.voiceTone
(string, optional): Tone of the voice in the paraphrase (e.g., 'Neutral').context
(string, optional): Additional context for paraphrasing.const statusUrl = await sharpApi.paraphrase("Original text to paraphrase.", "English", 100, "Neutral", null);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The text to proofread.const statusUrl = await sharpApi.proofread("This is a txt with erors.");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The content to generate SEO tags from.language
(string, optional): Language of the SEO tags (default: 'English').voiceTone
(string, optional): Tone of the voice in the SEO tags (e.g., 'Neutral').const statusUrl = await sharpApi.generateSeoTags("Content for SEO tag generation.", "English", "Neutral");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
text
(string): The travel review text.const statusUrl = await sharpApi.travelReviewSentiment("The trip was amazing!");
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
productName
(string): Name of the product.city
(string, optional): City related to the product.country
(string, optional): Country related to the product.language
(string, optional): Language of the response (default: 'English').maxQuantity
(number, optional): Maximum number of categories to generate.voiceTone
(string, optional): Tone of the voice in the response (e.g., 'Neutral').context
(string, optional): Additional context for category generation.const statusUrl = await sharpApi.toursAndActivitiesProductCategories(
"City Tour",
"Paris",
"France",
"English",
5,
"Neutral",
null
);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
productName
(string): Name of the product.city
(string, optional): City related to the product.country
(string, optional): Country related to the product.language
(string, optional): Language of the response (default: 'English').maxQuantity
(number, optional): Maximum number of categories to generate.voiceTone
(string, optional): Tone of the voice in the response (e.g., 'Neutral').context
(string, optional): Additional context for category generation.const statusUrl = await sharpApi.hospitalityProductCategories(
"Luxury Hotel",
"New York",
"USA",
"English",
5,
"Neutral",
null
);
const resultJob = await sharpApi.fetchResults(statusUrl);
console.log(resultJob.getResultJson());
For detailed usage and API methods, please refer to the SharpAPI.com Documentation.
Please see CHANGELOG for more information on what has changed recently.
Check CONTRIBUTION.md file for details.
This project is licensed under the MIT License.
If you encounter any issues or have questions, feel free to open an issue on the GitHub repository or contact support at contact@sharpapi.com.
Happy Coding with SharpAPI Node.js SDK Client!
FAQs
SharpAPI.com Node.js SDK Client - AI-powered workflow automation API.
We found that @sharpapi/sharpapi-node-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.