{"id":32558344,"url":"https://github.com/shellicar/svelte-adapter-azure-functions","last_synced_at":"2026-01-20T16:52:21.942Z","repository":{"id":269887280,"uuid":"908760905","full_name":"shellicar/svelte-adapter-azure-functions","owner":"shellicar","description":"A SvelteKit adapter that builds your app into an Azure Function.","archived":false,"fork":false,"pushed_at":"2025-10-24T10:02:17.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T12:08:50.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellicar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2024-12-26T22:39:39.000Z","updated_at":"2025-10-24T10:00:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9e628cb-0a0d-4d60-ab66-df97aeaa2c3f","html_url":"https://github.com/shellicar/svelte-adapter-azure-functions","commit_stats":null,"previous_names":["shellicar/svelte-adapter-azure-functions"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/shellicar/svelte-adapter-azure-functions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellicar%2Fsvelte-adapter-azure-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellicar%2Fsvelte-adapter-azure-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellicar%2Fsvelte-adapter-azure-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellicar%2Fsvelte-adapter-azure-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellicar","download_url":"https://codeload.github.com/shellicar/svelte-adapter-azure-functions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellicar%2Fsvelte-adapter-azure-functions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281178948,"owners_count":26456678,"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-10-26T02:00:06.575Z","response_time":61,"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":"2025-10-28T23:54:23.392Z","updated_at":"2025-10-28T23:55:21.459Z","avatar_url":"https://github.com/shellicar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @shellicar/svelte-adapter-azure-functions\n\n[![npm package](https://img.shields.io/npm/v/@shellicar/svelte-adapter-azure-functions.svg)](https://npmjs.com/package/@shellicar/svelte-adapter-azure-functions)\n[![build status](https://github.com/shellicar/svelte-adapter-azure-functions/actions/workflows/node.js.yml/badge.svg)](https://github.com/shellicar/svelte-adapter-azure-functions/actions/workflows/node.js.yml)\n[![Azure Functions](https://img.shields.io/badge/Azure%20Functions-v4-0078D4?logo=azure-functions)][azure-functions]\n[![SvelteKit](https://img.shields.io/badge/SvelteKit-2-FF3E00?logo=svelte)][sveltekit]\n[![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript)][typescript]\n[![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60A5FA?logo=biome)][biome]\n\nA [SvelteKit adapter](https://kit.svelte.dev/docs/adapters) that builds your app into an Azure Function.\n\n\u003c!-- BEGIN_ECOSYSTEM --\u003e\n\n## @shellicar TypeScript Ecosystem\n\n### Core Libraries\n\n- [`@shellicar/core-config`](https://github.com/shellicar/core-config) - A library for securely handling sensitive configuration values like connection strings, URLs, and secrets.\n- [`@shellicar/core-di`](https://github.com/shellicar/core-di) - A basic dependency injection library.\n\n### Reference Architectures\n\n- [`@shellicar/reference-foundation`](https://github.com/shellicar/reference-foundation) - A comprehensive starter repository. Illustrates individual concepts.\n- [`@shellicar/reference-enterprise`](https://github.com/shellicar/reference-enterprise) - A comprehensive starter repository. Can be used as the basis for creating a new Azure application workload.\n\n### Build Tools\n\n- [`@shellicar/build-clean`](https://github.com/shellicar/build-clean) - Build plugin that automatically cleans unused files from output directories.\n- [`@shellicar/build-version`](https://github.com/shellicar/build-version) - Build plugin that calculates and exposes version information through a virtual module import.\n- [`@shellicar/build-graphql`](https://github.com/shellicar/build-graphql) - Build plugin that loads GraphQL files and makes them available through a virtual module import.\n\n### Framework Adapters\n\n- [`@shellicar/svelte-adapter-azure-functions`](https://github.com/shellicar/svelte-adapter-azure-functions) - A [SvelteKit adapter](https://kit.svelte.dev/docs/adapters) that builds your app into an Azure Function.\n- [`@shellicar/cosmos-query-builder`](https://github.com/shellicar/cosmos-query-builder) - Helper class for type safe advanced queries for Cosmos DB (Sql Core).\n\n### Logging \u0026 Monitoring\n\n- [`@shellicar/winston-azure-application-insights`](https://github.com/shellicar/winston-azure-application-insights) - An [Azure Application Insights](https://azure.microsoft.com/en-us/services/application-insights/) transport for [Winston](https://github.com/winstonjs/winston) logging library.\n- [`@shellicar/pino-applicationinsights-transport`](https://github.com/shellicar/pino-applicationinsights-transport) - [Azure Application Insights](https://azure.microsoft.com/en-us/services/application-insights) transport for [pino](https://github.com/pinojs/pino)\n\n\u003c!-- END_ECOSYSTEM --\u003e\n\n## Motivation\n\nLooking at the available SvelteKit adapters, there's one for Node.js and a community adapter for Azure Static Web Apps. I wanted to deploy to Azure Functions, so I created this adapter.\n\n## Implementation\n\nThe adapter generates a single Azure Function:\n\n```typescript\napp.http('server', {\n  handler,\n  route: '{*url}',\n  methods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT']\n});\n```\n\n## Usage\n\n```bash\npnpm add -D @shellicar/svelte-adapter-azure-functions\n```\n\nIn `svelte.config.js`:\n```js\nimport adapter from '@shellicar/svelte-adapter-azure-functions';\n\nexport default {\n  kit: {\n    adapter: adapter()\n  }\n};\n```\n\n## Configuration\n\n### esbuildOptions\n\n```js\nadapter({\n  esbuildOptions: {\n    minify: false\n  }\n})\n```\n\nDefault options in [defaults.ts](./src/defaults.ts):\n```typescript\nexport const defaults = {\n  bundle: true,\n  platform: 'node',\n  target: 'node20',\n  format: 'esm',\n  // ...see defaults.ts for full options\n};\n```\n\n### Function authLevel\n\nThe trigger uses the following code, and the authLevel can be changed using the `SERVER_AUTH_LEVEL` environment variable.\n\n```ts\nimport { app } from '@azure/functions';\nimport { handler } from './handler';\n\nconst getAuthLevel = (level: string | undefined) =\u003e {\n  switch(level) {\n    case 'function':\n      return 'function';\n    case 'admin':\n      return 'admin';\n    case 'anonymous':\n      return 'anonymous';\n  }\n  return 'anonymous';\n};\n\napp.http('server', {\n  handler,\n  authLevel: getAuthLevel(process.env.SERVER_AUTH_LEVEL),\n  route: '{*url}',\n  methods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'],\n});\n```\n\n\n## Credits\n\n* [svelte-adapter-azure-swa](https://github.com/geoffrich/svelte-adapter-azure-swa)\n* [esbuild-azure-functions](https://github.com/beyerleinf/esbuild-azure-functions)\n\n[azure-functions]: https://learn.microsoft.com/azure/azure-functions/functions-reference-node?tabs=typescript%2Cwindows%2Cazure-cli\u0026pivots=nodejs-model-v4\n[sveltekit]: https://kit.svelte.dev\n[typescript]: https://www.typescriptlang.org\n[biome]: https://biomejs.dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellicar%2Fsvelte-adapter-azure-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellicar%2Fsvelte-adapter-azure-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellicar%2Fsvelte-adapter-azure-functions/lists"}