Express middleware and helpers for Twilic binary request and response bodies.
pnpm add @twilic/express express @twilic/coreimport express from "express";
import { twilicParser, twilicSend } from "@twilic/express";
const app = express();
app.post("/users", twilicParser(), (req, res) => {
twilicSend(res, { ok: true, received: req.twilicBody });
});Do not mount express.json() before Twilic routes on the same path, or the request body stream will already be consumed. Use a dedicated router or place twilicParser() on routes that do not use JSON body parsing.
TWILIC_CONTENT_TYPEparseTwilic(req)twilicSend(res, value, init?)twilicParser(options?)createTwilicExpress(codec?)
See docs/CHANGELOG.md.
The package ships build artifacts from dist/.
Local dry run:
pnpm build
pnpm packGitHub Actions publish uses npm trusted publishing (OIDC)—no long-lived NPM_TOKEN secret.
One-time setup on npmjs.com: open the package → Settings → Trusted Publisher → GitHub Actions, then set Organization or user twilic, Repository express, and Workflow filename publish-npm.yml (exact name, including .yml). See also GitHub Actions OIDC.
Release steps:
- Update docs/CHANGELOG.md and bump
versioninpackage.json. - Create and push matching tag
v<version>.
Example:
git tag v0.1.0
git push origin v0.1.0The workflow .github/workflows/publish-npm.yml verifies tag/version match, runs tests, and then runs npm publish (OIDC authentication via id-token: write).
See docs/CONTRIBUTING.md.
This project is licensed under the MIT License - see the LICENSE file for details.