rw.project
The rw.project object provides access to project-level settings and metadata.
Properties
Property
Type
Description
title
String
The project title
mode
String
Current mode: "edit" or "preview"
siteUrl
String
The site's base URL
language
String
Project language code (e.g., "en")
enableSocialTags
Boolean
Whether social tags are enabled
allowDarkMode
Boolean
Whether dark mode is enabled
logo.url
String
Path to the project logo
logo.alt
String
Alt text for the project logo
Accessing Project Data
const transformHook = (rw) => {
const { title, mode, siteUrl, language } = rw.project;
console.log(title); // "My Website"
console.log(mode); // "edit" or "preview"
console.log(siteUrl); // "https://example.com"
console.log(language); // "en"
};
exports.transformHook = transformHook;Edit vs Preview Mode
One of the most common uses is detecting the current mode:
Accessing the Project Logo
Passing Project Data to Templates
In templates:
Last updated
Was this helpful?

