
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
clarifai-node-serverless
Advanced tools

This is the official Node.js client library for working with Clarifai's API in serverless environments. This library is designed to be lightweight, compatible with modern ESM syntax, and optimized for serverless platforms like AWS Lambda, Vercel, and Netlify.
This library currently includes only a small subset of features from the main Clarifai Node.js SDK package. We are actively working on adding more features and improvements. If you need a specific feature, please let us know by opening an issue or joining our Discord community.
Website | Schedule Demo | Signup for a Free Account | API Docs | Clarifai Community | Discord
Give the repo a star ⭐
npm install clarifai-node-serverless
Clarifai uses Personal Access Tokens(PATs) to validate requests. You can create and manage PATs under your Clarifai account security settings.
Export your PAT as an environment variable. Then, import and initialize the API Client.
Set PAT as environment variable through terminal:
export CLARIFAI_PAT={your personal access token}
or use dotenv to load environment variables via a .env
file
import { Workflow, getInputFromUrl } from "clarifai-node-serverless";
const GENERAL_WORKFLOW =
"https://clarifai.com/my-org/celebrity-check/workflows/General";
const CELEBRITY_IMAGE = "https://samples.clarifai.com/celebrity.jpeg";
const workflow = new Workflow({
url: GENERAL_WORKFLOW,
authConfig: {
pat: process.env.CLARIFAI_PAT!,
},
});
const input = getInputFromUrl({
url: CELEBRITY_IMAGE,
inputType: "image",
});
const response = await workflow.predict({
inputs: [input],
});
console.log(response);
If you were previously using the clarifai-nodejs-grpc package or you want to access the full range of Clarifai API features, you can use the GRPC client directly.
import {
PostModelOutputsRequest,
V2Client,
} from "clarifai-node-serverless/grpc/proto/clarifai/api/service";
import { ChannelCredentials, Metadata } from "@grpc/grpc-js";
import { StatusCode } from "clarifai-node-serverless/grpc/proto/clarifai/api/status/status_code";
const client = new V2Client(
"api.clarifai.com:443",
ChannelCredentials.createSsl(),
);
const postModelOutputsRequest = PostModelOutputsRequest.fromPartial({
modelId: "aaa03c23b3724a16a56b629203edc62c",
inputs: [
{
data: {
image: {
url: "https://samples.clarifai.com/dog2.jpeg",
},
},
},
],
});
const metadata = new Metadata();
metadata.set("authorization", `key ${process.env.CLARIFAI_PAT}`);
client.postModelOutputs(postModelOutputsRequest, metadata, (err, response) => {
if (err) {
console.log("Error: " + err);
return;
}
if (response?.status?.code !== StatusCode.SUCCESS) {
console.log(
"Received failed status: " +
response?.status?.description +
"\n" +
response?.status?.details,
);
return;
}
console.log("results:");
console.log(response?.outputs);
});
FAQs

We found that clarifai-node-serverless demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.