Browser SDK
The Browser SDK lets you embed a Content Publisher document on any page, on any website, without development or configuration beyond inserting the javascript calls the page HTML content.
Add this script tag either in the <head> or before closing the <body> tag.
Replace “<your PCC Site ID>” by the collection ID of your choice.
Replace “<your PCC Token>” by a valid Access Token (aka GQL Token for that collection.
<script src="https://unpkg.com/@pantheon-systems/pcc-browser-sdk@latest/dist/index.js"
data-site-id="<your PCC Site ID>"
data-token="<your PCC Token>"
></script>
Add this pcc-article element anywhere where you want the article to be rendered.
Replace “<id of your article>” by the ID of your document that can be identified in your Google Docs URL. For instance, for a document at https://docs.google.com/document/d/1x9Za1e2R8MIylf00Aik3SzFkHTAcH7K8aF5IStU4xKI/edit?tab=t.0 the ID of the article is 1x9Za1e2R8MIylf00Aik3SzFkHTAcH7K8aF5IStU4xKI.
<pcc-article id="<id of your article>">
<!-- Add a fallback message here for when the article is loading... -->
Loading...
</pcc-article>
Here is a complete example. You could place this in a file called test.html and run it locally.
<html>
<head>
</head>
<body>
<pcc-article id="<id of your article>">
<!-- Add a fallback message here for when the article is loading... -->
Loading...
</pcc-article>
<script
src="https://unpkg.com/@pantheon-systems/pcc-browser-sdk@latest/dist/index.js"
data-site-id="<your PCC Site ID>"
data-token="<your PCC Token>"
></script>
</body>
</html>
For example, to load content in a single-page application, in an infinite scroll, or any other situation where the page has already loaded.
This is not currently supported, but if you have this use case, please let us know.