Skip to content

mykhailo-monchak/tilda-client

Repository files navigation

Tilda API client for Node.js and browser

This is a Tilda API client for Node.js and browser written in Typescript.

Installation

npm i tilda-client

or

yarn add tilda-client

Simple Example

As demonstrated by this example, you can get a list of all projects and load detailed project data. The detailed project object contains CSS and JS data.

And also you can get a list of all pages in the project and load complete page data per each of them. The detailed page object contains HTML of the page.

You can also choose to load short or full, and standard or export versions of pages or projects. Find more detail on the API description page.

import { TildaClient, TildaProject, TildaProjectData, TildaPage, TildaPageData } from 'tilda-client';

...

const tilda = new TildaClient(config.TILDA_PUBLIC_KEY, config.TILDA_SECRET_KEY);

const projects: TildaProject[] = await tilda.getProjectsList();
console.log(`${projects.length} projects have been loaded.`);

for (const p of projects) {
    const project: TildaProjectData = await tilda.getProject(p.id);
    console.log(`${project.title} project has been loaded.`);

    const pages: TildaPage[] = await tilda.getPagesList(p.id);
    console.log(`${pages.length} pages have been loaded.`);

    for (const pg of pages) {
        const page: TildaPageData = await tilda.getPage(pg.id);
        console.log(`${page.title} page has been loaded.`);
    }
}

Configuration

You can get public and secret keys in your Tilda account here.

Please read Tilda API documentation and pay attention that there is a limit to the number of requests as 150 per hour.

Need Help?

Drop me an email to Mikhail Monchak

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published