Skip to content

Installation

Every Slingshot app starts here:

Terminal window
bun add @lastshotlabs/slingshot hono zod

Installs defineApp(), createServer(), createApp(), the CLI, route discovery, OpenAPI helpers, and the entity/operations authoring tools.

Install only what your app needs:

Terminal window
bun add @lastshotlabs/slingshot-auth # accounts, sessions, JWT, MFA, OAuth, passkeys
bun add @lastshotlabs/slingshot-community # forums, threads, replies, reactions, moderation
bun add @lastshotlabs/slingshot-permissions # RBAC/ABAC — required when using community or orgs
bun add @lastshotlabs/slingshot-organizations # teams, membership, invite flows
bun add @lastshotlabs/slingshot-search # full-text search across entities
bun add @lastshotlabs/slingshot-mail # transactional email
bun add @lastshotlabs/slingshot-push # push notifications
bun add @lastshotlabs/slingshot-webhooks # outbound webhook delivery
bun add @lastshotlabs/slingshot-admin # admin panel surface
bun add @lastshotlabs/slingshot-m2m # machine-to-machine tokens
bun add @lastshotlabs/slingshot-scim # SCIM provisioning for enterprise SSO

If you’re building config-driven domain packages with defineEntity() and createEntityPlugin():

Terminal window
bun add @lastshotlabs/slingshot-entity

Slingshot runs on Bun or Node.js. On Bun, the runtime is auto-detected — no extra install needed. For Node.js, install the Node runtime package and its dependencies:

Terminal window
# Node.js only — Bun users can skip this
bun add @lastshotlabs/slingshot-runtime-node
bun add better-sqlite3 argon2 @hono/node-server ws fast-glob
app.config.ts
// Node.js only — pass the runtime explicitly
import { defineApp } from '@lastshotlabs/slingshot';
import { nodeRuntime } from '@lastshotlabs/slingshot-runtime-node';
export default defineApp({ runtime: nodeRuntime(), port: 3000 });

On Bun, omit runtime entirely — @lastshotlabs/slingshot-runtime-bun is auto-detected.

Slingshot adapters are peer dependencies — install the driver for the databases you use:

Terminal window
# MongoDB
bun add mongoose
# Redis (for sessions, cache, queues)
bun add ioredis
# PostgreSQL
bun add @lastshotlabs/slingshot-postgres

SQLite is handled by the runtime package — bun:sqlite on Bun, better-sqlite3 on Node.

These are peer dependencies — install only when the feature is enabled in your config:

Terminal window
# OAuth social login
bun add @lastshotlabs/slingshot-oauth arctic
# TOTP / time-based MFA
bun add otpauth
# WebAuthn passkeys
bun add @simplewebauthn/server
# File uploads to S3 / R2 / GCS
bun add @aws-sdk/client-s3 @aws-sdk/s3-request-presigner @aws-sdk/lib-storage
# Durable queues (BullMQ event bus)
bun add bullmq
Terminal window
# Meilisearch
bun add meilisearch
# Typesense
bun add typesense
# Elasticsearch
bun add @elastic/elasticsearch
# Algolia
bun add algoliasearch
Terminal window
# Resend
bun add resend
# Postmark
bun add postmark
# SendGrid
bun add @sendgrid/mail
# Nodemailer (SMTP)
bun add nodemailer

@lastshotlabs/slingshot ships the slingshot CLI. After installing:

Terminal window
# Start the server — discovers app.config.ts in the current directory
slingshot start
# Run database migrations (Prisma-style flow)
slingshot migrate generate --name init # write a new migration from entity diffs
slingshot migrate apply # apply pending migrations to the DB
slingshot migrate status # show applied vs pending
slingshot migrate dev --name init # generate + apply, the inner-loop shortcut
# Generate entity source files (types, adapters) without applying SQL
slingshot generate --config ./app.config.ts --outdir ./src/generated
  • Bun v1.2 or later — recommended. Use Bun as your package manager and runtime.
  • Node.js 20+ — only if using the Node.js runtime adapter (@lastshotlabs/slingshot-runtime-node).

All examples in these docs use Bun. The only difference on Node.js is passing runtime: nodeRuntime() to defineApp.