feat: bootstrap contactkit monorepo#2
Merged
Conversation
Agent-Logs-Url: https://github.com/dimeloper/contactkit/sessions/90933aca-d736-477b-9c43-5a51db63b0a6 Co-authored-by: dimeloper <2801022+dimeloper@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dimeloper/contactkit/sessions/90933aca-d736-477b-9c43-5a51db63b0a6 Co-authored-by: dimeloper <2801022+dimeloper@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
dimeloper
May 6, 2026 16:37
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the full
@contactkit/serverand@contactkit/clientspec from scratch on top of the existing scaffold.Server (
@contactkit/server)EMAIL_PROVIDER,MAIL_TO,MAIL_FROM,MAIL_SUBJECT_PREFIX,ALLOWED_ORIGINS,RATE_LIMIT_MAX,RATE_LIMIT_WINDOW,LOG_LEVEL); fail-fast conditional validation (resend requiresRESEND_API_KEY, smtp requiresSMTP_HOST+SMTP_PORT)send()now acceptsreplyToand returnsPromise<{ id?: string }>; bothResendMailerandSmtpMailerupdated accordingly;replyToset to submitter's email on every sendPOST /contact— Addedsubjectfield; honeypot (website) checked pre-schema to silently return{ ok: true, id }without leaking 400; Turnstile failure returns 403; response always includes a message id (provider id orcrypto.randomUUID())GET /health— Returns{ status, uptime }(uptime in seconds since server start)GET /— New endpoint returning{ name, version }frompackage.jsonserver.ts— 16 KB body limit;trustProxy: true(Railway); rate limiting and log level wired from envClient (
@contactkit/client)ContactClient(renamed fromContactKitClient) —send()method (wassubmit());subjectfield;timeoutMsoption (default 10 s);fetchoption (wasfetchFn)ContactError(renamed fromContactKitError) — Exposesstatus: numberandcode: ContactErrorCode; status-to-code mapping:400→validation,403→captcha_failed,429→rate_limited,5xx→serverTests & tooling
MAIL_TO, missing provider creds),GET /,GET /health, valid contact (mailer called, id returned), subject+replyTo forwarding, invalid payload 400, honeypot silent 200, rate limit 429NetworkError,AbortError→ timeouttsc --noEmittypecheck step before lint.env.exampleand README updated to reflect new env var names, provider setup, and self-host notes