Where it opens
A grant opens Anywhere, or Only on my websites.
| Choice | Opens | Has a link |
|---|---|---|
| Anywhere | On its link page, and on any website that embeds it | Yes |
| Only on my websites | Only embedded on the websites you list | No |
Anywhere is right for what you’d hand out anyway: a brochure, a price list, a menu. Choose your websites when the document belongs to your site, such as a manual for your customers, and copying the embed code to another site shouldn’t work.
Listing your websites#
Write each website as its address, without a path, and separate them with commas:
| You write | It opens on |
|---|---|
https://www.fernquill.example | That site only |
https://*.fernquill.example | Every subdomain, such as docs.fernquill.example, but not fernquill.example itself |
http://localhost:3000 | Your own computer, while you build |
A grant takes up to 32 websites. Each needs https:// or http://, and a port when it isn’t the
usual one.
What it protects#
A browser says which website a page is on, and CloudPDF checks it before the document opens. So the grant can’t be embedded anywhere else: CloudPDF refuses to open it there.
It’s protection against your document turning up on someone else’s site, not against a determined person: code outside a browser can claim to be any website. For people who must not see the document at all, use a passphrase, or your own sign-in with tokens.
In code#
await cloudpdf.grants.create({
tenantId,
docId: manual.documentId,
name: 'Customer manual',
scope: permissions.read,
origins: [
'https://www.fernquill.example',
'https://*.fernquill.example',
],
});Without origins, a grant opens anywhere. Tokens take origins too.