{"id":15136734,"url":"https://github.com/maniecodes/fastify-appwrite","last_synced_at":"2025-07-30T00:36:48.256Z","repository":{"id":137054618,"uuid":"395127905","full_name":"maniecodes/fastify-appwrite","owner":"maniecodes","description":"Fastify plugin for interacting with Appwrite","archived":false,"fork":false,"pushed_at":"2021-09-06T18:36:32.000Z","size":170,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-09T12:07:44.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/maniecodes.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}},"created_at":"2021-08-11T22:10:32.000Z","updated_at":"2024-11-14T08:37:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"33a10f62-7fc8-4301-993f-bfe5ed45be59","html_url":"https://github.com/maniecodes/fastify-appwrite","commit_stats":null,"previous_names":["dev-manny/fastify-appwrite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maniecodes/fastify-appwrite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Ffastify-appwrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Ffastify-appwrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Ffastify-appwrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Ffastify-appwrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maniecodes","download_url":"https://codeload.github.com/maniecodes/fastify-appwrite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniecodes%2Ffastify-appwrite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267785895,"owners_count":24144124,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-09-26T06:40:59.890Z","updated_at":"2025-07-30T00:36:48.225Z","avatar_url":"https://github.com/maniecodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastify Plugin for Appwrite\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)\n\nSupports Fastify versions `3.x`\n\n**This SDK is compatible with Appwrite server version 0.9.x.**\n\n\u003e This is the Fastify Plugin for integrating with Appwrite from your Fastify server-side code.\n\nAppwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)\n\n![Appwrite](https://appwrite.io/images/github.png)\n\n## Installation\n\nTo install via [NPM](https://www.npmjs.com/):\n\n```bash\nnpm install fastify-appwrite --save\n```\n\n## Usage\n\nRequire `fastify-appwrite` and register.\n\n```js\nconst fastify = require(\"fastify\")();\n\nfastify.register(require(\"fastify-appwrite\"), {\n  // put your options here\n});\n\nconst start = async () =\u003e {\n  await fastify.ready();\n\n  try {\n    await fastify.listen(3000);\n    await fastify.appwrite.client\n      .setEndpoint(\"https://[HOSTNAME_OR_IP]/v1\") // Your API Endpoint\n      .setProject(\"5df5acd0d48c2\") // Your project ID\n      .setKey(\"919c2d18fb5d4...a2ae413da83346ad2\") // Your secret API key\n      .setSelfSigned(); // Use only on dev mode with a self-signed SSL cert\n  } catch (error) {\n    fastify.log.error(error);\n    process.exit(1);\n  }\n};\n\nstart();\n```\n\n### Make Your First Request\n\nOnce your fastify plugin is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in the [API References](https://appwrite.io/docs) section.\n\n```js\n// User Schema\nconst User = {\n  type: \"object\",\n  properties: {\n    $id: { tpye: \"string\" },\n    name: { type: \"string\" },\n    registration: { type: \"number\" },\n    status: { type: \"number\" },\n    email: { type: \"string\" },\n    emailVerification: { type: \"boolean\" },\n  },\n};\n\n// Create a user Schema\nconst postUserOpts = {\n  schema: {\n    body: {\n      type: \"object\",\n      required: [\"email\", \"password\"],\n      properties: {\n        email: { type: \"string\" },\n        password: { type: \"string\" },\n        name: { type: \"string\" },\n      },\n    },\n    response: {\n      201: User,\n    },\n  },\n};\n\n// Get all users Schema\nconst getUsersOpts = {\n  schema: {\n    response: {\n      200: {\n        type: \"array\",\n        items: User,\n      },\n    },\n  },\n};\n\nasync function userRoutes(fastify, opts) {\n  fastify.post(\"/users\", postUserOpts, async (req, reply) =\u003e {\n    const { email, password, name } = req.body;\n    const result = await fastify.appwrite.user.create(email, password, name);\n    if (result.status != 201) {\n      return reply.code(result.status).send(result.data);\n    }\n    reply.code(result.status).send(result.response);\n  });\n\n  fastify.get(\"/users\", getUsersOpts, async (req, reply) =\u003e {\n    const result = await fastify.appwrite.user.list();\n    reply.code(result.status).send(result.response.users);\n  });\n}\n\nmodule.exports = userRoutes;\n```\n\n### Error Handling\n\nThe Appwrite Fastify plugin raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.\n\n```js\ntry {\n  let res = await fastify.appwrite.users.create(\"email@example.com\", \"password\");\n} catch (e) {\n  console.log(e.message);\n}\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\u003cbr/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniecodes%2Ffastify-appwrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaniecodes%2Ffastify-appwrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniecodes%2Ffastify-appwrite/lists"}