Skip to content

Commit

Permalink
chore: better docs for usage (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
chustert authored Nov 19, 2024
1 parent 9a0382b commit 7c7bb43
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,28 @@ import { WebflowClient } from "webflow-api";

const webflow = new WebflowClient({ accessToken });

const site = await webflow.sites.get("site-id");
// Env. variables
// in format of string, e.g.: "639656400769508adc12fe42"
const site_id = process.env.SITE_ID;
const custom_domain_id_1 = process.env.CUSTOM_DOMAIN_ID_1;
const custom_domain_id_2 = process.env.CUSTOM_DOMAIN_ID_2;

// Sites

// List Sites
const sites = await webflow.sites.list();

// Get Site
const site = await webflow.sites.get("site_id");

// Get Custom Domains
const customDomains = await webflow.sites.getCustomDomain(site_id);

// Publish Site
const site = await webflow.sites.publish(site_id, {
customDomains: [custom_domain_id_1, custom_domain_id_2],
publishToWebflowSubdomain: true,
});
```

## OAuth
Expand Down

0 comments on commit 7c7bb43

Please sign in to comment.