Skip to content

Configurator ​

Tick what your app needs, and copy the two blocks into your project: one for build.gradle.kts, one for install(Svelte).

  • Only settings that differ from the defaults appear, so the result stays short.
  • The panel on the right recommends what most apps should turn on. Click Apply to take a recommendation.
Frontend libraries svelte { }
Build svelte { }
API install(Svelte) { }
Operations
Security
Development

Recommended

  • OperationsPin Bun so CI and new laptops build without installing anything.
  • OperationsAdd a health endpoint for Docker, Kubernetes or a load balancer.
  • OperationsSet your public address so sitemap.xml and robots.txt never depend on the Host header.
  • SecurityRefuse JSON bodies with huge strings.
  • SecurityAdd a strict rate limit for your login route.
  • PerformanceResize images and serve AVIF and WebP automatically.
build.gradle.kts
import io.github.nijasc.ktor.svelte.gradle.DaisyTheme

svelte {
    libraries {
        daisyUi {
            themes(DaisyTheme.ShadcnLight, DaisyTheme.ShadcnDark)
            defaultTheme(DaisyTheme.ShadcnLight)
            prefersDark(DaisyTheme.ShadcnDark)
        }
        lucide()
        toasts()
        routes()
    }
}
Application.kt
import io.github.nijasc.ktor.svelte.Svelte

install(Svelte) {
    generateTs = true
    apiDocs = true
}

Only settings that differ from the defaults are shown. Run ./gradlew svelteSync after changing libraries, and ./gradlew svelteConfig to review the result.

Where to go from here ​

Documentation for ktor-svelte 1.4.0. Released under the Apache 2.0 license.