Log In
Get
Docs
Showcase
Community

Core Packages

DeploySolo’s core packages in pkg/ extend PocketBase for htmx-driven apps. Import them to add auth, rendering, payments, and more. Focus on the essentials: middleware and render for every app; payment and github for SaaS features.

middleware

Handles auth cookies to make htmx requests work with PocketBase’s token-based auth. Apply AuthCookieMiddleware() globally or per-route group.

Example in main.go:

se.Router.Bind(middleware.AuthCookieMiddleware())

render

Loads Go HTML templates and renders them with data, supporting htmx partials. Call LoadTemplates(pb, “web/templates”) in main.go. Render full pages or fragments:

return render.Render("todo.html", tasks)(e)  // full template
return render.RenderRaw("task", newTask)(e) // partial block

Templates use Go’s html/template with htmx attributes. See Working with Templates.

payment

payment.RegisterPayment(se, &payment.Config{
    StripeSecretKey:     os.Getenv("STRIPE_SECRET_KEY"),
    StripeWebhookSecret: os.Getenv("STRIPE_WEBHOOK_SECRET"),
    StripePriceID:       os.Getenv("STRIPE_PRICE_ID"),
    DomainName:          os.Getenv("DOMAIN_NAME"),
    LoginEndpoint:       "/login",
})

Adds routes like /checkout, /webhook. See Adding Stripe for details.

github

Enables GitHub repo invites for users. Register with config:

github.RegisterInvite(se, &github.Config{
    GHUsername: os.Getenv("GH_USERNAME"),
    GHRepo:     os.Getenv("GH_REPO"),
    GHPAT:      os.Getenv("GH_PAT"),
})