{"id":26122957,"url":"https://github.com/clarifai/clarifai-nodejs-grpc","last_synced_at":"2026-04-02T01:43:18.182Z","repository":{"id":38788166,"uuid":"217546811","full_name":"Clarifai/clarifai-nodejs-grpc","owner":"Clarifai","description":"Clarifai gRPC NodeJS client","archived":false,"fork":false,"pushed_at":"2026-03-27T16:23:45.000Z","size":14565,"stargazers_count":49,"open_issues_count":4,"forks_count":8,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-03-28T01:20:45.858Z","etag":null,"topics":["ai","clarifai","clarifai-client","grpc","nodejs"],"latest_commit_sha":null,"homepage":"https://docs.clarifai.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clarifai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-25T14:03:28.000Z","updated_at":"2026-03-24T11:50:37.000Z","dependencies_parsed_at":"2023-10-05T02:35:26.765Z","dependency_job_id":"f978f582-d761-485a-a2ce-455fed4401dc","html_url":"https://github.com/Clarifai/clarifai-nodejs-grpc","commit_stats":null,"previous_names":["clarifai/clarifai-javascript-grpc"],"tags_count":241,"template":false,"template_full_name":null,"purl":"pkg:github/Clarifai/clarifai-nodejs-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clarifai%2Fclarifai-nodejs-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clarifai%2Fclarifai-nodejs-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clarifai%2Fclarifai-nodejs-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clarifai%2Fclarifai-nodejs-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clarifai","download_url":"https://codeload.github.com/Clarifai/clarifai-nodejs-grpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clarifai%2Fclarifai-nodejs-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","clarifai","clarifai-client","grpc","nodejs"],"created_at":"2025-03-10T15:13:56.534Z","updated_at":"2026-04-02T01:43:18.166Z","avatar_url":"https://github.com/Clarifai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://github.com/user-attachments/assets/562d54f1-eb2e-444c-8f1f-616d069bff3b)\n\n\n# Clarifai Node.js gRPC Client\n\nThis is the official Clarifai gRPC Node.js client for interacting with our powerful recognition\n[API](https://docs.clarifai.com).\nClarifai provides a platform for data scientists, developers, researchers and enterprises to master the entire\nartificial intelligence lifecycle. Gather valuable business insights from images, video and text using computer vision\nand natural language processing.\n\n* Try the Clarifai demo at: https://clarifai.com/demo\n* Sign up for a free account at: https://portal.clarifai.com/signup\n* Read the documentation at: https://docs.clarifai.com/\n\n\n[![npm](https://img.shields.io/npm/v/clarifai-nodejs-grpc)](https://www.npmjs.com/package/clarifai-nodejs-grpc)\n[![Build](https://github.com/Clarifai/clarifai-javascript-grpc/workflows/Run%20tests/badge.svg)](https://github.com/Clarifai/clarifai-nodejs-grpc/actions)\n\n## Installation\n\n```\nnpm install clarifai-nodejs-grpc\n```\n\n## Versioning\n\nThis library doesn't use semantic versioning. The first two version numbers (`X.Y` out of `X.Y.Z`) follow the API (backend) versioning, and\nwhenever the API gets updated, this library follows it.\n\nThe third version number (`Z` out of `X.Y.Z`) is used by this library for any independent releases of library-specific improvements and bug fixes.\n\n\n## Getting started\n\nThere are two approaches to using this library: the dynamic and the static. The former has been around for a longer\ntime, but latter provides type annotations via TypeScript declaration files which improves the IDE auto-completion\nexperience to be more developer-friendly. Both approaches provide the exact same API capabilities.\n\n### The dynamic approach\n\nConstruct the Clarifai stub, which contains all the methods available in the Clarifai API, and the `Metadata`\nobject that's used to authenticate:\n\n```javascript\nconst {ClarifaiStub, grpc} = require(\"clarifai-nodejs-grpc\");\n\nconst stub = ClarifaiStub.grpc();\n\nconst metadata = new grpc.Metadata();\nmetadata.set(\"authorization\", \"Key YOUR_CLARIFAI_API_KEY\");\n```\n\nPredict concepts in an image:\n\n```javascript\nstub.PostModelOutputs(\n    {\n        // This is the model ID of a publicly available General model. You may use any other public or custom model ID.\n        model_id: \"aaa03c23b3724a16a56b629203edc62c\",\n        inputs: [{data: {image: {url: \"https://samples.clarifai.com/dog2.jpeg\"}}}]\n    },\n    metadata,\n    (err, response) =\u003e {\n        if (err) {\n            console.log(\"Error: \" + err);\n            return;\n        }\n\n        if (response.status.code !== 10000) {\n            console.log(\"Received failed status: \" + response.status.description + \"\\n\" + response.status.details);\n            return;\n        }\n\n        console.log(\"Predicted concepts, with confidence values:\")\n        for (const c of response.outputs[0].data.concepts) {\n            console.log(c.name + \": \" + c.value);\n        }\n    }\n);\n```\n\nSee more [in the Clarifai API Guide docs](https://docs.clarifai.com/api-guide/api-overview). Also see \n[the integration tests](tests/test_integration_dynamic.js).\n\n\u003e Note: Do not require the `grpc` library directly via `const grpc = require(\"@grpc/grpc-js\");`. This produces\n\u003e authentication issues (via `grpc.Metadata`) whenever any other co-installed libraries have the `@grpc/grpc-js`\n\u003e dependency (of a different version). Instead, require `grpc` as shown above.\n\n\n### The static approach\n\nCreate the `V2Client` object with which you access all the Clarifai API functionality, and the `Metadata`\nobject that's used to authenticate:\n\n```javascript\nconst {grpc} = require(\"clarifai-nodejs-grpc\");\nconst service = require(\"clarifai-nodejs-grpc/proto/clarifai/api/service_pb\");\nconst resources = require(\"clarifai-nodejs-grpc/proto/clarifai/api/resources_pb\");\nconst {StatusCode} = require(\"clarifai-nodejs-grpc/proto/clarifai/api/status/status_code_pb\");\nconst {V2Client} = require(\"clarifai-nodejs-grpc/proto/clarifai/api/service_grpc_pb\");\n\nconst clarifai = new V2Client(\"api.clarifai.com\", grpc.ChannelCredentials.createSsl());\n\nconst metadata = new grpc.Metadata();\nmetadata.set(\"authorization\", \"Key YOUR_CLARIFAI_API_KEY\");\n```\n\nPredict concepts in an image:\n\n```javascript\nconst request = new service.PostModelOutputsRequest();\n// This is the model ID of a publicly available General model. You may use any other public or custom model ID.\nrequest.setModelId(\"aaa03c23b3724a16a56b629203edc62c\");\nrequest.addInputs(\n    new resources.Input()\n        .setData(\n            new resources.Data()\n                .setImage(\n                    new resources.Image()\n                        .setUrl(\"https://samples.clarifai.com/dog2.jpeg\")\n                )\n        )\n)\n\nclarifai.postModelOutputs(\n    request,\n    metadata,\n    (error, response) =\u003e {\n        if (error) {\n            throw error;\n        }\n\n        if (response.getStatus().getCode() !== StatusCode.SUCCESS) {\n            throw \"Error: \" + response.getStatus();\n        }\n\n        console.log(\"Predicted concepts, with confidence values:\")\n        for (const concept of response.getOutputsList()[0].getData().getConceptsList()) {\n            console.log(concept.getName() + \" \" + concept.getValue());\n        }\n    }\n)\n```\n\nSee more [in the Clarifai API Guide docs](https://docs.clarifai.com/api-guide/api-overview). Also see\n[the integration tests](tests/test_integration.js).\n\n\u003e Note: Currently, the NodeJS gRPC code examples [in the Clarifai documentation](https://docs.clarifai.com/api-guide/api-overview) \nshow only the dynamic approach. These code examples can easily be translated to the static approach, since the structure \nis the same for both of them. The difference is only in the syntax.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarifai%2Fclarifai-nodejs-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclarifai%2Fclarifai-nodejs-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarifai%2Fclarifai-nodejs-grpc/lists"}