Skip to content

Commit 7c7bb43

Browse files
authored
chore: better docs for usage (#174)
1 parent 9a0382b commit 7c7bb43

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,28 @@ import { WebflowClient } from "webflow-api";
6565

6666
const webflow = new WebflowClient({ accessToken });
6767

68-
const site = await webflow.sites.get("site-id");
68+
// Env. variables
69+
// in format of string, e.g.: "639656400769508adc12fe42"
70+
const site_id = process.env.SITE_ID;
71+
const custom_domain_id_1 = process.env.CUSTOM_DOMAIN_ID_1;
72+
const custom_domain_id_2 = process.env.CUSTOM_DOMAIN_ID_2;
73+
74+
// Sites
75+
76+
// List Sites
77+
const sites = await webflow.sites.list();
78+
79+
// Get Site
80+
const site = await webflow.sites.get("site_id");
81+
82+
// Get Custom Domains
83+
const customDomains = await webflow.sites.getCustomDomain(site_id);
84+
85+
// Publish Site
86+
const site = await webflow.sites.publish(site_id, {
87+
customDomains: [custom_domain_id_1, custom_domain_id_2],
88+
publishToWebflowSubdomain: true,
89+
});
6990
```
7091

7192
## OAuth

0 commit comments

Comments
 (0)