CloudPDF
DocsPricing
Start building

Where it opens

A grant opens Anywhere, or Only on my websites.

ChoiceOpensHas a link
AnywhereOn its link page, and on any website that embeds itYes
Only on my websitesOnly embedded on the websites you listNo

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.

Where it opens: Only on my websites, with two websites listed

Listing your websites#

Write each website as its address, without a path, and separate them with commas:

You writeIt opens on
https://www.fernquill.exampleThat site only
https://*.fernquill.exampleEvery subdomain, such as docs.fernquill.example, but not fernquill.example itself
http://localhost:3000Your 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.