Embed dynamic variables inside Portable Text content in Sanity Studio, then resolve them to real values at render time in React. Think mail merge for rich text - an editor writes "Hello, {firstName}!" and the frontend substitutes the actual value at runtime.
This project ships three independent, decoupled packages:
| Package | Purpose |
|---|---|
sanity-plugin-pte-interpolation |
Sanity Studio schema helper that adds variable picker inline blocks to the Portable Text Editor |
pte-interpolation-react |
React rendering library that resolves variable blocks to real values |
pte-interpolation-core |
Framework-agnostic utilities for variable extraction and plain string interpolation |
See each package's README for full installation, usage, and API documentation.
pnpm install
pnpm dev # starts Studio + test app in parallelSee Local Development for the full dev workflow.
MIT
