{"id":21835770,"url":"https://github.com/vtex/node-vtex-api","last_synced_at":"2025-04-06T06:13:22.660Z","repository":{"id":8873543,"uuid":"59686164","full_name":"vtex/node-vtex-api","owner":"vtex","description":"VTEX IO API Client for Node","archived":false,"fork":false,"pushed_at":"2024-06-11T18:55:54.000Z","size":3755,"stargazers_count":75,"open_issues_count":51,"forks_count":16,"subscribers_count":143,"default_branch":"master","last_synced_at":"2024-09-20T09:22:33.309Z","etag":null,"topics":["node","npm","srv-io-web-framework","vtex-io","xp-developer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vtex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-25T18:04:45.000Z","updated_at":"2024-06-11T18:52:55.000Z","dependencies_parsed_at":"2023-10-25T15:52:25.216Z","dependency_job_id":"635fcc42-aa2b-4819-80d6-987558870329","html_url":"https://github.com/vtex/node-vtex-api","commit_stats":null,"previous_names":["vtex/apps-client-node"],"tags_count":818,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex%2Fnode-vtex-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex%2Fnode-vtex-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex%2Fnode-vtex-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex%2Fnode-vtex-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vtex","download_url":"https://codeload.github.com/vtex/node-vtex-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441059,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["node","npm","srv-io-web-framework","vtex-io","xp-developer"],"created_at":"2024-11-27T20:24:30.974Z","updated_at":"2025-04-06T06:13:22.632Z","avatar_url":"https://github.com/vtex.png","language":"TypeScript","readme":"# VTEX IO API Client for Node\n\nThis library enables developers to quickly integrate with the VTEX IO APIs and create full fledged node services using VTEX IO.\n\n[![Build Status](https://travis-ci.org/vtex/node-vtex-api.svg?branch=master)](https://travis-ci.org/vtex/node-vtex-api)\n\n## Getting started\n\nFor a complete example on using `@vtex/api`, check out this app: https://github.com/vtex-apps/service-example\n\nThe most basic usage is to export a new `Service()` with your route handlers:\n\n```javascript\n// Import global types\nimport './globals'\n\nimport { Service } from '@vtex/api'\n\nimport { clients } from './clients'\nimport example from './handlers/example'\n\n// Export a service that defines route handlers and client options.\nexport default new Service({\n  clients,\n  routes: {\n    example,\n  },\n})\n```\n\nThis allows you to define middlewares that receive a `Context` param which contains all IO Clients in the `clients` property:\n\n```javascript\nexport const example = async (ctx: Context, next: () =\u003e Promise\u003cvoid\u003e) =\u003e {\n  const {state: {code}, clients: {apps}} = ctx\n  console.log('Received code:', code)\n\n  const apps = await apps.listApps()\n  \n  ctx.status = 200\n  ctx.body = apps\n  ctx.set('Cache-Control', 'private')\n\n  await next()\n}\n```\n\n`ctx.clients.apps` is an instance of `Apps`.\n\n## Development\n\n- Install the dependencies: `yarn`\n- Watch for changes: `yarn watch`\n\n### Development with IO clients\n\n- Install the dependencies: `yarn`\n- [Link](https://classic.yarnpkg.com/en/docs/cli/link/) this package: `yarn link`\n- Watch for changes: `yarn watch`\n- Move to the app that depends on the changes made on this package: `cd ../\u003cyour-app\u003e/node`\n- Link this package to your app's node_modules: `yarn link @vtex/api`\n\nNow, when you get a workspace up and running for your app with `vtex link`, you'll have this package linked as well.\n\n\u003e When done developing, don't forget to unlink it from `\u003cyour-app\u003e/node`: `yarn unlink @vtex/api`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtex%2Fnode-vtex-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvtex%2Fnode-vtex-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtex%2Fnode-vtex-api/lists"}