Overview
An embed block frames a page you host inside a customer’s Custral workspace. Registering one takes three things from you: the origin Custral frames, the URL template it loads, and the scopes your page needs to read the workspace. Custral reviews that declaration, and a workspace admin accepts the scopes when they install your module. By the end of this page your block will be in review, and you will know what a workspace does to install it.You need an approved provider first. See Become a provider.
Before you start
- Serve the page over
https://from an origin you control, such ashttps://embed.acme.com. - Let Custral frame it. A
Content-Security-Policy: frame-ancestorsorX-Frame-Optionsheader that blocks Custral renders your block as an empty box. The portal can check this for you (step 4). - Implement the handshake if you ask for scopes. Your page posts
custral:readyand receives its token in reply. See Embed blocks.
1. Create the block
1
Open the provider portal
Go to app.custral.com/provider.
2
Click New embed block
On Overview, or New embed under Embeds.
3
Name it
Give it a Key (a stable handle such as
acme.overview-panel), a name and icon, and a description. The name and description are what workspace members see in the block picker.2. Put it in a module
A workspace installs a module, and installing is where the admin is shown the scopes your blocks ask for. Put every embed that requests scopes in one.1
Create a module
In Modules, click Create Module and give it a key, a name and a description, e.g. “Acme panels”. A new module starts Private.
2
Assign the block
Back on the block’s Block tab, pick the module and click Save Settings.
3. Declare the embed
Open the block’s Embed tab.
The template can use these placeholders. Each value is URL-encoded, and a value that isn’t available becomes an empty parameter.
Scopes an embed can ask for
An embed’s token reaches workspace data, never workspace credentials. So three scopes can never be declared:applications:manage and webhooks:manage (either would let your page mint a permanent key) and widget:identify (it vouches for who a customer’s visitors are).
The token is accepted by
/v1. Ask for the least you need. The installing admin sees the list, and the token is further narrowed to what the viewer can already do: a read-only member gets a token that cannot write.
4. Check it, then submit
1
Read the resolved URL
Once the declaration is valid, What Custral will actually request shows your template filled in with obviously fake ids. This is the line your reviewer reads.
2
Click Check my site allows framing
Custral requests the page and reads its framing headers. Your site refuses to be framed means it would render as an empty box; allow Custral as a frame ancestor and check again. Couldn’t tell is not a refusal and does not block review.
3
Click Save and submit for review
The block’s state changes to In review.
Review
A Custral reviewer answers three questions about the declaration:- Does the origin belong to your provider?
- Are the scopes plausible for what the block does?
- Can the URL template resolve anywhere other than the declared origin?
What changes after approval
How a workspace installs it
1
The admin opens Settings → Integrations
Your module is listed on the Modules tab once Custral has listed both your provider and the module.
2
They click Install Module and review your scopes
An Install <module name> prompt lists what your blocks can read. A module whose blocks request no scopes installs straight through.
3
Members add your block to a page
It appears in the block picker alongside Custral’s own blocks.
Troubleshooting
Related
- Embed blocks: the handshake, the token, and reading rows
- Become a provider: the portal and developer access
- Build for other workspaces: applications vs providers vs embeds
- Embed block: the version customers configure with a pasted URL