Appearance
Quickstart
Prerequisites
You'll need a Tectly account and the provided credentials to use our API.
Client SDKs
It is highly recommended that you access our API through our client SDKs. Currently we offer Python, TypeScript and PHP packages.
The Tectly TypeScript Client contains the JavaScript bindings and types of the Tectly Rest API with some convenience functions for ease of use.
Install the bindings from NPM using your package manager.
sh
npm i @tectly/clientUsage
The simplest way to get started is to use the TectlyClient.
ts
// Node >= 24
const fileBuffer = readFileSync(join(__dirname, process.env.TECTLY_TEST_FILE));
const file = new File([fileBuffer], "floor-plan.png", { type: "image/png" });
let client = await new TectlyClient().authenticate(
process.env.TECTLY_API_KEY,
process.env.TECTLY_API_SECRET,
);
const project = await client.projectsApi.createProject({
projectCreate: { title: "My project" },
});
const documentSummary = await client.documentsApi.addDocument({
id: project.id,
document: file,
});
const document = await client.waitForDocumentPageRenderingSettled(
documentSummary.id,
);
if (document.pageRenderingStatus !== ProcessingStatus.Positive) {
throw new Error("Document failed to render.");
}
const documentPromises = document.documentPages.map(async (pageSummary) => {
const page = await client.waitForPlanDetectionSettled(pageSummary.id);
return Promise.all(
page.plans.map(async (planSummary) => {
const plan = await client.waitForPlanProcessingSettled(planSummary.id);
if (plan.floorId == null) return null;
const floor = await client.floorsApi.fetchFloor({ id: plan.floorId });
return floor;
}),
);
});
const floors = (await Promise.all(documentPromises))
.flat()
.filter((floor) => floor != null);
// Do something with the floors.INFO
Do you need an SDK for a different language? Please contact us!