-
Notifications
You must be signed in to change notification settings - Fork 1
Preview
github-actions edited this page Nov 30, 2023
·
2 revisions
Contains references to where to download or get details.
Name | Type | Description |
---|---|---|
orderingKey |
string |
The number of which page of the order this is. |
url |
string |
The URL to download the page. |
detailsUrl |
string |
The URL to get details about the page. |
Download the page.
Parameters
Name | Type | Default | Description |
---|---|---|---|
polling |
boolean |
true |
Whether to poll the API until the page is ready to download. |
timeout |
number |
20 |
The maximum amount of time in seconds to wait for the page to be ready to download. |
Returns: Promise<ArrayBuffer>
Example
const template = await client.getTemplate("example-template-id");
const preview = await template.getPreview();
const download = await preview[0].download();
Get details about the page.
Parameters
Name | Type | Default | Description |
---|---|---|---|
polling |
boolean |
true |
Whether to poll the API until the page is ready to download. |
timeout |
number |
20 |
The maximum amount of time in seconds to wait for the page to be ready to download. |
Returns: Promise<PreviewDetails>
Example
const template = await client.getTemplate("example-template-id");
const preview = await template.getPreview();
const details = await preview[0].getDetails();
Make a preview of the template.
Parameters
Name | Type | Description |
---|---|---|
mergeVariables |
object |
The merge variables to use in the preview. Is an object with the merge variable name as key. |
Returns: Promise<Preview>
Example
const previews = await template.preview({
name: "John Doe",
address: "Main Street 1",
});