{"_id":"@arcjet-vendor/connectrpc-connect-fastify","_rev":"3-99c7786dff4d48e57887913b77166137","name":"@arcjet-vendor/connectrpc-connect-fastify","dist-tags":{"latest":"1.7.1"},"versions":{"1.7.1":{"name":"@arcjet-vendor/connectrpc-connect-fastify","version":"1.7.1","license":"Apache-2.0","_id":"@arcjet-vendor/connectrpc-connect-fastify@1.7.1","maintainers":[{"name":"quinn-arcjet","email":"quinn@arcjet.com"}],"homepage":"https://github.com/connectrpc/connect-es#readme","bugs":{"url":"https://github.com/connectrpc/connect-es/issues"},"dist":{"shasum":"2f670a417361781f093b77c9850d338013ff71dc","tarball":"https://registry.npmjs.org/@arcjet-vendor/connectrpc-connect-fastify/-/connectrpc-connect-fastify-1.7.1.tgz","fileCount":11,"integrity":"sha512-HRC+VKFL6G1+Ichfucxrh2fvRId3WBOsrMgGZkwPq4MRSZhPgwGDNVagAnciWPOJGxLpXK/zU9O2Z1mpNBKNHA==","signatures":[{"sig":"MEUCIQCeNak0AxZtR6x3TvDXcSS7fbV133M/PIclvGeOjC1bfQIgQJXQEmB9Z9aNMhQU+g5Y62Tzty+wTkZOvpY+oW2W7vc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18435},"main":"./dist/cjs/index.js","type":"module","types":"./dist/cjs/index.d.ts","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"f7eddb5136ff9cfd48b03377925b3053f848e09c","scripts":{"attw":"attw --pack","lint":"eslint --max-warnings 0 .","build":"npm run build:cjs && npm run build:esm","format":"prettier --write --ignore-unknown '.' '!dist'","prebuild":"rm -rf ./dist/*","build:cjs":"tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'","build:esm":"tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm","conformance":"tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-fastify.yaml -v -- tsx ./conformance/server.ts","license-header":"license-header"},"_npmUser":{"name":"quinn-arcjet","email":"quinn@arcjet.com"},"repository":{"url":"git+https://github.com/connectrpc/connect-es.git","type":"git","directory":"packages/connect-fastify"},"_npmVersion":"10.8.2","description":"> ⚠️ **Vendored fork**   > Maintained by Arcjet for internal/product use. May diverge from upstream.","directories":{},"sideEffects":false,"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"@arcjet-vendor/connectrpc-connect":"1.7.1","@arcjet-vendor/connectrpc-connect-node":"1.7.1","@arcjet-vendor/connectrpc-connect-conformance":"^1.7.1"},"peerDependencies":{"fastify":"^4.22.1","@bufbuild/protobuf":"^1.10.0","@arcjet-vendor/connectrpc-connect":"1.7.1","@arcjet-vendor/connectrpc-connect-node":"1.7.1"},"_npmOperationalInternal":{"tmp":"tmp/connectrpc-connect-fastify_1.7.1_1769558352461_0.4127423816766589","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-01-27T23:59:12.366Z","modified":"2026-02-06T01:49:41.163Z","1.7.1":"2026-01-27T23:59:12.615Z"},"bugs":{"url":"https://github.com/connectrpc/connect-es/issues"},"license":"Apache-2.0","homepage":"https://github.com/connectrpc/connect-es#readme","repository":{"url":"git+https://github.com/connectrpc/connect-es.git","type":"git","directory":"packages/connect-fastify"},"description":"> ⚠️ **Vendored fork**   > Maintained by Arcjet for internal/product use. May diverge from upstream.","maintainers":[{"name":"davidmytton","email":"david@arcjet.com"},{"name":"quinn-arcjet","email":"quinn@arcjet.com"}],"readme":"> ⚠️ **Vendored fork**  \n> Maintained by Arcjet for internal/product use. May diverge from upstream.\n\n# @arcjet-vendor/connectrpc-connect-fastify\n\nConnect is a family of libraries for building and consuming APIs on different languages and platforms, and\n[@arcjet-vendor/connectrpc-connect](https://www.npmjs.com/package/@arcjet-vendor/connectrpc-connect) brings type-safe APIs with Protobuf to\nTypeScript.\n\n`@arcjet-vendor/connectrpc-connect-fastify` provides a plugin for [fastify](https://www.fastify.io/), the fast and\nlow overhead web framework, for Node.js.\n\n### fastifyConnectPlugin()\n\nPlug your Connect RPCs into a fastify server.\n\n```ts\n// connect.ts\nimport { ConnectRouter } from \"@arcjet-vendor/connectrpc-connect\";\n\nexport default function (router: ConnectRouter) {\n  // implement rpc Say(SayRequest) returns (SayResponse)\n  router.rpc(ElizaService, ElizaService.methods.say, async (req) => ({\n    sentence: `you said: ${req.sentence}`,\n  }));\n}\n```\n\n```diff\n// server.ts\nimport { fastify } from \"fastify\";\n+ import routes from \"connect\";\n+ import { fastifyConnectPlugin } from \"@arcjet-vendor/connectrpc-connect-fastify\";\n\nconst server = fastify({\n  http2: true,\n});\n\n+ await server.register(fastifyConnectPlugin, {\n+  routes\n+ });\n\nawait server.listen({\n  host: \"localhost\",\n  port: 8080,\n});\n```\n\nWith that server running, you can make requests with any gRPC, gRPC-Web, or Connect client.\n\n`buf curl` with the gRPC protocol:\n\n```bash\nbuf curl --schema buf.build/connectrpc/eliza \\\n  --protocol grpc --http2-prior-knowledge \\\n  -d '{\"sentence\": \"I feel happy.\"}' \\\n  http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say\n```\n\n`curl` with the Connect protocol:\n\n```bash\ncurl \\\n    --header \"Content-Type: application/json\" \\\n    --data '{\"sentence\": \"I feel happy.\"}' \\\n    --http2-prior-knowledge \\\n    http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say\n```\n\nNode.js with the gRPC protocol (using a transport from [@arcjet-vendor/connectrpc-connect-node](https://www.npmjs.com/package/@arcjet-vendor/connectrpc-connect-node)):\n\n```ts\nimport { createClient } from \"@arcjet-vendor/connectrpc-connect\";\nimport { createGrpcTransport } from \"@arcjet-vendor/connectrpc-connect-node\";\nimport { ElizaService } from \"./gen/eliza_connect.js\";\n\nconst transport = createGrpcTransport({\n  baseUrl: \"http://localhost:8080\",\n  httpVersion: \"2\",\n});\n\nconst client = createClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence); // you said: I feel happy.\n```\n\nA client for the web browser actually looks identical to this example - it would\nsimply use `createConnectTransport` from [@arcjet-vendor/connectrpc-connect-web](https://www.npmjs.com/package/@arcjet-vendor/connectrpc-connect-web)\ninstead.\n\n## Getting started\n\nTo get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started)\nfor a tutorial, or take a look at [our example](https://github.com/connectrpc/connect-es/tree/main/packages/example).\n","readmeFilename":"README.md"}