{"id":17727783,"url":"https://github.com/samk-dev/nuxt-appwrite-ii","last_synced_at":"2026-01-18T08:33:33.482Z","repository":{"id":240996642,"uuid":"804024831","full_name":"samk-dev/nuxt-appwrite-ii","owner":"samk-dev","description":"Appwrite Client and Server integration for Nuxt. It'a a bit opinionated to suit the projects I am working on","archived":false,"fork":false,"pushed_at":"2024-05-28T20:02:45.000Z","size":509,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T20:29:20.350Z","etag":null,"topics":["appwrite","nuxt","ssr"],"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/samk-dev.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":"2024-05-21T20:10:01.000Z","updated_at":"2024-09-02T15:31:33.000Z","dependencies_parsed_at":"2024-05-28T23:04:33.246Z","dependency_job_id":"20b1fd1e-f3ca-4246-87e1-4b9921007f2c","html_url":"https://github.com/samk-dev/nuxt-appwrite-ii","commit_stats":null,"previous_names":["samk-dev/nuxt-appwrite-ii"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samk-dev/nuxt-appwrite-ii","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samk-dev%2Fnuxt-appwrite-ii","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samk-dev%2Fnuxt-appwrite-ii/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samk-dev%2Fnuxt-appwrite-ii/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samk-dev%2Fnuxt-appwrite-ii/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samk-dev","download_url":"https://codeload.github.com/samk-dev/nuxt-appwrite-ii/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samk-dev%2Fnuxt-appwrite-ii/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["appwrite","nuxt","ssr"],"created_at":"2024-10-25T18:22:33.394Z","updated_at":"2026-01-18T08:33:33.463Z","avatar_url":"https://github.com/samk-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nuxt Appwrite II\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n[![Nuxt][nuxt-src]][nuxt-href]\n\nAppwrite Client and Server integration for Nuxt. It'a a bit opinionated to suit the projects I am working on, feel free to use it but before using please checkout [nuxt-appwrite-ii by @Hrdtr](https://nuxt.com/modules/appwrite)\n\n- [✨ \u0026nbsp;Changelog](/CHANGELOG.md)\n\u003c!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/nuxt-appwrite-ii?file=playground%2Fapp.vue) --\u003e\n\u003c!-- - [📖 \u0026nbsp;Documentation](https://example.com) --\u003e\n\n## Features\n\n- Web SDK\n- Server Side SDK\n- i18n ready\n- Use one at a time or both\n- flexibility to have different connections per SDK\n\n## Quick Setup\n\nInstall Appwrite official SDK's. The module doesn't install them for better flexibility.\n\n```bash\n# Web SDK\n\nnpm install appwrite\n\npnpm add appwrite\n\nyarn install appwrite\n\n# Server side\n\nnpm install node-appwrite\n\npnpm add node-appwrite\n\nyarn install node-appwrite\n\n### ⚠️ THE CURRENT STABLE VERSION OF NODE APPWRITE HAS ISSUES ON EDGE RUNTIMES. TEMPORARY WORKAROUND IS TO INSTALL node-appwrite@next WILL FIX THE ISSUE ⚠️ ###\n```\n\nInstall the module to your Nuxt application with one command:\n\n```bash\nnpx nuxi module add nuxt-appwrite-ii\n```\n\nThat's it! You can now use Nuxt Appwrite II in your Nuxt app\n\n## Web SDK\n\nAdd your Appwrite credentials.\n\n- `enabled` Enable/Disable Web SDK - default `true`\n- `endpoint` The default endpoint is `https://cloud.appwrite.io/v1`\n- `projectId` Project ID __the module will not load if missing__\n- `defaultLocale` default `en`\n\n```ts\nexport default defineNuxtConfig({\n  // ...restOfConfig\n  modules: ['nuxt-appwrite-ii'],\n  nuxtAppwrite: {\n    client: {\n      enabled: true,\n      endpoint: 'https://cloud.appwrite.io/v1',\n      projectId: '', // required**\n      defaultLocale: 'en'\n    },\n  },\n  // ...restOfConfig\n})\n```\n\n### `useAppwrite` composable\n\nYou can destructure `account, databases, functions, storage, teams, avatars, locale, Permission, Query, Role, AppwriteException, ID` from `useAppwrite()`\n\n```ts\nconst { account } = useAppwrite()\n\n// example getting current loggedin account\ntry {\n  const user = await account.get()\n  console.log(user)\n} catch (error) {\n  console.log(error)\n}\n```\n\n## Server Side\n\nAdd your Appwrite credentials.\n\n- `enabled` Enable/Disable Web SDK - default `false`\n- `endpoint` The default endpoint is `https://cloud.appwrite.io/v1`\n- `projectId` Project ID __the module will not load if missing__\n- `apiKey` Api Key __the module will not load if missing__\n- `cookieName` Session cookie name - default `a_session`\n- `i18nCookieKey` nuxt-i18n cookie key - default `i18n_redirected`\n- `defaultLocale` default `en`\n\n```ts\nexport default defineNuxtConfig({\n  // ...restOfConfig\n  modules: ['nuxt-appwrite-ii'],\n  nuxtAppwrite: {\n    //client: {...clientoptions},\n    server: {\n      enabled: true,\n      endpoint: 'https://cloud.appwrite.io/v1',\n      projectId: '', // required**\n      apiKey: '', // required**\n      cookieName: 'a_session',\n      i18nCookieKey: 'i18n_redirected',\n      defaultLocale: 'en'\n    }\n  },\n  // ...restOfConfig\n})\n```\n\nThe server side integration should be used with caution as it exposes 2 clients, `useAppwriteSSRAdminClient` and `useAppwriteSSRSessionClient`\n\n### `useAppwriteSSRAdminClient` Server Util\n\nThis composable needs an `API KEY` with at least `session.create` permissions. It can be used to create sessions,\ndo administrative tasks. *__CAUTION WITH WHAT YOU DO WITH THE UTIL AS IT ACTS ON BEHALF OF APPWRITE SUPER ADMIN AND BYPASS ANY RATE LIMITS AND PERMISSIONS__*\n\n```ts\nimport { useAppwriteSSRAdminClient } from '#nuxt-appwrite-ssr'\n\nexport default defineEventHandler(async (event) =\u003e {\n  const { email, password } = await readBody\u003c{ email: string, password: string }\u003e(event)\n  const { account, AppwriteException } = useAppwriteSSRAdminClient(event)\n\n  const config = useRuntimeConfig(event)\n\n  try {\n    const session = await account.createEmailPasswordSession(email, password)\n\n    setCookie(event, config.appwrite.cookieName, session.secret, {\n      expires: new Date(session.expire),\n      path: '/',\n      httpOnly: true,\n      secure: true,\n      sameSite: 'strict',\n    })\n\n    return { status: 'success', message: 'session created' }\n  }\n  catch (error: any) {\n    if (error instanceof AppwriteException) {\n      return createError({\n        statusCode: error.code,\n        statusMessage: error.message,\n        message: error.name,\n      })\n    }\n    return createError(error)\n  }\n})\n\n```\n\n### `useAppwriteSSRSessionClient` Server Util\n\nThis composable is used after the `useAppwriteSSRAdminClient` as it uses the session created. And will respect any applied rate limits and permissions for the user.\n\n```ts\nimport { useAppwriteSSRSessionClient } from '#nuxt-appwrite-ssr'\n\nexport default defineEventHandler(async (event) =\u003e {\n  const { account, AppwriteException } = useAppwriteSSRSessionClient(event)\n\n  try {\n    return await account.get()\n  }\n  catch (error: any) {\n    if (error instanceof AppwriteException) {\n      return createError({\n        statusCode: error.code,\n        statusMessage: error.message,\n        message: error.name,\n      })\n    }\n    return createError(error)\n  }\n})\n\n```\n\n## i18n Support\n\nThe Web SDK relies on `nuxt-i18n` `i18n:beforeLocaleSwitch` and updates the client locale header automatically.\n\nThe Server SDK relies on `nuxt-i18n` `i18nCookieKey` and updates the client locale header automatically.\n\n## Contribution\n\n\u003cdetails\u003e\n  \u003csummary\u003eLocal development\u003c/summary\u003e\n  \n  ```bash\n  # Install dependencies\n  npm install\n  \n  # Generate type stubs\n  npm run dev:prepare\n  \n  # Develop with the playground\n  npm run dev\n  \n  # Build the playground\n  npm run dev:build\n  \n  # Run ESLint\n  npm run lint\n  \n  # Run Vitest\n  npm run test\n  npm run test:watch\n  \n  # Release new version\n  npm run release\n  ```\n\n\u003c/details\u003e\n\n## Credits\n\n- Inspiration -\u003e Nuxt Supabase Module\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-appwrite-ii/latest.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[npm-version-href]: https://npmjs.com/package/nuxt-appwrite-ii\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-appwrite-ii.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[npm-downloads-href]: https://npmjs.com/package/nuxt-appwrite-ii\n\n[license-src]: https://img.shields.io/npm/l/nuxt-appwrite-ii.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[license-href]: https://npmjs.com/package/nuxt-appwrite-ii\n\n[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js\n[nuxt-href]: https://nuxt.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk-dev%2Fnuxt-appwrite-ii","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamk-dev%2Fnuxt-appwrite-ii","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk-dev%2Fnuxt-appwrite-ii/lists"}