@planningcenter/wrapped
v2.0.0
Published
PCO Wrapped components
Keywords
Readme
@planningcenter/wrapped
This package enables adding a Planning Center Wrapped banner to your app with ease! Exported as a React component, it includes everything needed. All you need to do is set window.pco.wrapped before it renders!
Light mode
Dark mode
Installation
Add the package
yarn add @planningcenter/wrappedIf your app doesn't use Tapestry yet, add it too. It's a peer dependency:
yarn add @planningcenter/tapestryHost requirements
- React 17, 18 or 19 and
@planningcenter/tapestry(^4.15.0) installed in the host app (peer dependencies) - Load
@planningcenter/tapestry/tapestry-reset.css, then@planningcenter/tapestry/index.css, before the app's own styles - A bundler that handles
.svgasset imports from packages (Tapestry and icons rely on it)
Add the banner to your layout
PcoWrappedBanner takes no props. It reads window.pco.wrapped, which the host must set before the banner renders (rendering earlier throws):
window.pco = { wrapped: { enabled: true, siteAdmin: false, shared: false } }enabledshows the bannersiteAdminshows the Share button (on Home)sharedpreselects "Any logged in user" in the share modal. It's only read on first render; later changes come from the share modal, which saves them withPATCH /wrapped, not from the global
import { PcoWrappedBanner } from "@planningcenter/wrapped"
function Layout() {
return <PcoWrappedBanner />
}That's it!
Development
Playground
Run the local playground to see the banner without mounting it in a Planning Center app:
yarn playgroundThen open the URL Vite prints (it picks a free port, starting at 5173). The drawer at the bottom toggles the window.pco.wrapped flags, brings the banner back after you dismiss it, and has "See on Home" to reload on home.localhost:<port>, where the Share button appears. Requires Node 20.19+.
Before releasing, still check your changes in a consuming app such as Home.
Clone the repo
git clone [email protected]:planningcenter/wrapped.gitcd into the gem and start the microbuild watcher.
This will automatically output the built JS file.
cd pco-wrapped && yarn devIf you need to re-build JS without running the watcher you can run
yarn buildContributing
Commit changes, submit a PR, then release a new version!
