$ ls docs/

DocumentationDocumentação

Start with the quickstart and the security model. Recipes show whole features; each middleware and package has its own page.Comece pelo quickstart e pelo modelo de segurança. As receitas mostram funcionalidades inteiras; cada middleware e pacote tem página própria.

InstallInstalar
pnpm add @tupik/core @tupik/node

Version 1.0.0 on npm. With npm: npm install @tupik/core @tupik/node.Versão 1.0.0 no npm. Com npm: npm install @tupik/core @tupik/node.

StartComeçar

  • QuickstartQuickstart

    Create an app with createApp, declare access on every route and answer your first request.Crie um app com createApp, declare access em toda rota e responda sua primeira requisição.

  • ExamplesExemplos

    Six example apps: minimal API, SaaS on Workers and D1, webhooks, realtime, Hono mount and MCP server.Seis apps de exemplo: API mínima, SaaS no Workers com D1, webhooks, tempo real, montagem no Hono e servidor MCP.

SecuritySegurança

GuidesGuias

MiddlewareMiddlewares

  • MiddlewareMiddlewares

    How middleware attaches to routes and the pipeline order, with a focused guide for every shipped middleware.Como o middleware se liga às rotas e a ordem do pipeline, com um guia para cada middleware disponível.

  • CORSCORS

    Answer preflights and allow cross-origin requests with the cors middleware.Responda preflights e permita requisições de outras origens com o middleware cors.

  • Rate limitingLimite de requisições

    Limit requests per key with a fixed window, a memory store or your own RateLimitStore.Limite requisições por chave com janela fixa, store em memória ou seu próprio RateLimitStore.

  • JWTJWT

    Verify HMAC bearer tokens and expose claims through ctx.rawStore with the jwt middleware.Verifique tokens Bearer HMAC e exponha as claims em ctx.rawStore com o middleware jwt.

  • Request loggerLogger de requisições

    Emit one structured JSON line per request with method, path, status and duration.Emita uma linha JSON estruturada por requisição com método, caminho, status e duração.

  • CompressionCompressão

    Compress responses with CompressionStream while respecting negotiation and cache headers.Comprima respostas com CompressionStream respeitando negociação e headers de cache.

  • HelmetHelmet

    Add security headers without overwriting values your app already set.Adicione headers de segurança sem sobrescrever valores que a app já definiu.

  • Request IDID de requisição

    Propagate one request id through a response header and ctx.rawStore with a trusted-header policy.Propague um id de requisição por um header de resposta e ctx.rawStore com política de header confiável.

  • CookiesCookies

    Parse incoming cookies and serialize Set-Cookie values with the cookies middleware and helpers.Leia cookies de entrada e serialize valores Set-Cookie com o middleware cookies e seus helpers.

  • Server-TimingServer-Timing

    Add one Server-Timing duration to the response header, or append to a value already set.Adicione uma duração Server-Timing ao header de resposta, ou anexe a um valor já definido.

  • CSRFCSRF

    Protect state-changing routes with a signed double-submit token cookie and header.Proteja rotas que mudam estado com um token double-submit assinado em cookie e header.

  • SessionsSessões

    Server-side sessions behind an opaque __Host- cookie, with D1, KV or memory stores, rotation and revocation.Sessões no servidor atrás de um cookie __Host- opaco, com stores D1, KV ou memória, rotação e revogação.

  • TenantTenant (workspace)

    Resolve the workspace from a header, a subdomain or a function, always checked by a mandatory verify().Resolva o workspace por header, subdomínio ou função, sempre conferido por um verify() obrigatório.

  • Client IPIP do cliente

    Resolve the client IP once, under an explicit trust model, for logger, audit, rateLimit and ipAllow.Resolva o IP do cliente uma vez, com modelo de confiança explícito, para logger, audit, rateLimit e ipAllow.

  • Body limitLimite de corpo

    Reject request bodies over a byte limit with 413, the same way on Node, Bun and Workers.Recuse corpos acima de um limite de bytes com 413, do mesmo jeito em Node, Bun e Workers.

  • TimeoutTimeout

    Answer 503 (or 408) when a route takes too long and abort the work through an AbortSignal.Responda 503 (ou 408) quando a rota demora demais e aborte o trabalho por um AbortSignal.

  • Webhook signaturesAssinatura de webhooks

    Verify GitHub, Stripe, Asaas and custom webhooks: HMAC or token, time window and delivery dedup.Verifique webhooks do GitHub, Stripe, Asaas e próprios: HMAC ou token, janela de tempo e deduplicação.

  • IdempotencyIdempotência

    Honor the Idempotency-Key header: replay the first response, 422 on reuse, 409 while running.Respeite o header Idempotency-Key: repete a primeira resposta, 422 no reuso, 409 em andamento.

  • CaptchaCaptcha

    Verify Cloudflare Turnstile tokens on public forms, failing closed when the secret or the API is missing.Verifique tokens do Cloudflare Turnstile em formulários públicos, falhando fechado sem segredo ou API.

  • API keysChaves de API

    Authenticate with prefixed API keys, store only their SHA-256 and check scopes per route.Autentique com chaves de API com prefixo, guarde só o SHA-256 e confira escopos por rota.

  • Audit trailTrilha de auditoria

    Record who accessed what (principal, tenant, record ids, status) in a pluggable sink, never the body.Registre quem acessou o quê (principal, tenant, ids, status) num sink plugável, nunca o corpo.

  • Error reporterRelator de erros

    Send unexpected errors to a Sentry-compatible DSN, cleaned of personal data, without blocking the response.Envie erros inesperados a um DSN compatível com Sentry, sem dados pessoais e sem travar a resposta.

  • ETagETag

    Add ETags to GET responses and answer 304 Not Modified on If-None-Match.Adicione ETags a respostas GET e responda 304 Not Modified no If-None-Match.

  • Cache-ControlCache-Control

    Set Cache-Control per route, with no-store for authenticated responses, writes and errors.Defina Cache-Control por rota, com no-store para respostas autenticadas, escritas e erros.

  • LocaleIdioma (locale)

    Pick a typed locale from Accept-Language (q-values, base language) or your own choice.Escolha um locale tipado pelo Accept-Language (q-values, idioma base) ou pela sua escolha.

  • Maintenance modeModo de manutenção

    Answer 503 with Retry-After during maintenance, letting health checks or the ops team through.Responda 503 com Retry-After durante a manutenção, deixando passar health checks ou a equipe.

  • Basic authBasic auth

    Protect internal tools and staging with HTTP Basic, compared in constant time.Proteja ferramentas internas e staging com HTTP Basic, comparado em tempo constante.

  • IP allowlistLista de IPs permitidos

    Allow only IPv4/IPv6 addresses or CIDR ranges, using the IP resolved by clientIp.Permita só endereços ou faixas CIDR IPv4/IPv6, usando o IP resolvido pelo clientIp.

  • TracingTracing

    One OpenTelemetry span per request with HTTP semantics only; your attributes respect the route data classes.Um span OpenTelemetry por requisição só com a semântica HTTP; seus atributos respeitam as classes de dado da rota.

PackagesPacotes

  • Node.jsNode.js

    Serve the app with the native HTTP driver from @tupik/node.Sirva o app com o driver HTTP nativo do @tupik/node.

  • Edge & BunEdge e Bun

    Reuse the same app on Cloudflare Workers and Bun without Request adapters.Reuse o mesmo app em Cloudflare Workers e Bun sem adaptadores de Request.

  • Inside HonoDentro do Hono

    Mount a Tupik app in an existing Hono app and migrate one route at a time.Monte um app Tupik num app Hono que já existe e migre uma rota de cada vez.

  • Validated environmentAmbiente validado

    Declare variables, secrets and bindings once; if anything is missing in production, the app does not start.Declare variáveis, segredos e bindings uma vez; se faltar algo em produção, o app não sobe.

  • InfraInfra

    Storage, structured JSON logger with redaction and OpenTelemetry helpers from @tupik/infra.Storage, logger JSON estruturado com redação e helpers OpenTelemetry do @tupik/infra.

  • MCP serverServidor MCP

    Routes become tools for AI agents, with the same access rules and no personal data by default.As rotas viram ferramentas para agentes de IA, com as mesmas regras de acesso e sem dado pessoal por padrão.

ReferenceReferência

← Back to homeVoltar à home